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

188
Views
¿Por qué la llamada API ya no funciona desde una refactorización?

Hice este código useEffect que funciona bien en una pantalla:

 useEffect(() => { getDatasFromId(searchId) .then((data) => { const returnObject = { next: data.next, items: data.results.map(item => ({ name: item.name, url: item.url })) }; setHasNext(returnObject.next); setDataToDisplay(returnObject.items); }); }, [searchId]);

Pero ahora, hice algunas modificaciones y la llamada a la API se ejecuta sin retorno (sin error o lo que sea). Mi nuevo código es este:

 useEffect(() => { const apiUrl = getApiUrl(searchId); console.log("API URL : ", apiUrl); getDatas(apiUrl) .then((data) => { console.log("We get some data : ", data.results ); const returnObject = buildDataObject(data); console.log("returnObject : ", returnObject); setDataToDisplay(returnObject.items); returnObject.next !== null && loadMoreApiDatasIf(returnObject.next); }); }, [searchId]);

No veo el error en el nuevo código.

about 4 years ago · Juan Pablo Isaza
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!