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

635
Views
AsyncStorage siempre devuelve {"_U": 0, "_V": 0, "_W": nulo, "_X": nulo}
async function getTokenFromAsync() { const userToken = await AsyncStorage.getItem('@User_Token'); return userToken; } export default {getTokenFromAsync};

Estoy tratando de obtener el token de usuario de asyncStorage pero me devuelve esto {"_U": 0, "_V": 0, "_W": nulo, "_X": nulo}, estoy usando reaccionar nativo

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No está resolviendo la Promesa, por lo tanto, su salida "extraña".

Esta es la forma en que tengo definida mi función get:

 const getData = async (key) => { // get Data from Storage try { const data = await AsyncStorage.getItem(key); if (data !== null) { console.log(data); return data; } } catch (error) { console.log(error); } };

Luego puede obtener los datos llamando a la función con su clave.

 await getData("yourKey") .then(data => data) .then(value => { a state or constant = value console.log("yourKey Value: " + value) }) .catch(err => console.log(err))
about 4 years ago · Juan Pablo Isaza Report

0

Debe esperar para resolver la promesa donde la está usando como

 getTokenFromAsync().then((userToken)=>{ console.log(userToken); });
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!