Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!