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

291
Views
¿Cómo resolver el bucle infinito en JSX?

Estoy tratando de mapear mi estado de formulario de usuario para representar cada uno por cada uno, pero la función de mapa a veces me devuelve como indefenso y, a veces, como un ciclo infinito de reacción y no encuentro una manera de resolverlo, ¿alguien podría ayudarme?

mi código:

 const FormScreen = async({route}) => { const [userForm, setuserForm] = useState([]); if (userForm.length > 0) { console.log(userForm,'campos:',userForm.fields); return; } else { setuserForm(await JSON.parse(route.params.paramKey)); } {...} return ( <SafeAreaView style={{flex: 1}}> <View style={styles.container}> <Text style={styles.textStyle}> COLLECTION : </Text> {userForm.map((item) => ( <Text keys={item.fields}>test</Text> ))} </View> </SafeAreaView> ); };
over 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Mover setuserForm(await JSON.parse(route.params.paramKey)); en un gancho useEffect .

https://reactjs.org/docs/hooks-effect.html

over 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
Virtual assistant