Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

162
Vistas
React Native JSON.stringify() corrupts object

I have this which code takes a string (stored in a react hook) and puts it into a JSON object which is them stringified and stored in Async Storage. The value of the string is Client@monroinsights.co

let newModel = {
    email: email,
}
await AsyncStorage.setItem('@onboardingModel', JSON.stringify(newModel))

Whenever I later interact with this item in async storage, the Object looks like this:

"0": "{",
  "1": "\"",
  "10": "C",
  "11": "l",
  "12": "i",
  "13": "e",
  "14": "n",
  "15": "t",
  "16": "@",
  "17": "m",
  "18": "o",
  "19": "n",
  "2": "e",
  "20": "r",
  "21": "o",
  "22": "i",
  "23": "n",
  "24": "s",
  "25": "i",
  "26": "g",
  "27": "h",
  "28": "t",
  "29": "s",
  "3": "m",
  "30": ".",
  "31": "c",
  "32": "o",
  "33": "\"",
  "34": "}",
  "4": "a",
  "5": "i",
  "6": "l",
  "7": "\"",
  "8": ":",
  "9": "\"",

What am I doing wrong here?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It's hard to say what's wrong without seeing the code you've written to retrieve the value from async storage.

Is it possible you're forgetting to resolve the promise returned by getItem, i.e. something equivalent to:

JSON.parse(getItem('@onboardingModel'))

when you should be doing something more like what's shown in this function:

const getOnboardingModel = async () => (
  JSON.parse(await getItem('@onboardingModel'))
)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda