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

256
Views
Tengo el objeto de error que no es válido como tracto secundario (objeto encontrado...) Cuando llamo a una función asíncrona

Intento llamar a Octokit api (github) para verificar si sigo a las personas que me siguen.

Ahí está mi código:

 followers.map((followers) =>{ return( <Text> {followers.login} <Text> isFollowing? </Text> {checkisFollowing(followers.login)} ...

y ahí está mi verificación de función está golowing (fanfan)

 const checkisFollowing = async(fanfan) => { console.log(fanfan, "is following?") return("1") }
 and it gives me the error

Los objetos no son válidos como hijos de React (objeto con claves {_U, _V, _W, _X})

 I already checked on internet but i don't find the solution. Thanks for your answers!
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si la función es asíncrona y está solicitando algo de la API, debe tener un estado. Cuando checkisFollowing , debe actualizar el estado y, al regresar, muestra el valor del estado:

 const [checkFollowingState, setCheckFollowingState] = useState(""); const checkisFollowing = async(fanfan) => { console.log(fanfan, "is following?") // so async work setCheckFollowingState("1") } return ( <Text> {checkFollowingState} </Text>

Si tiene varias solicitudes, puede hacer lo siguiente:

 Promise.all([someAsyncRequest]).then(checkisFollowingArray => setCheckFollowingState(checkisFollowingArray)) ... return ( <Text> {checkFollowingState[0]} </Text>
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!