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

185
Views
Problema de rendimiento de la función de intervalo asíncrono nativo de React

Tengo un componente nativo de reacción que ejecuta una función asíncrona en un temporizador de intervalos. Al probar esto en un teléfono Android antiguo, me sorprendió ver algunos problemas graves de rendimiento.

Los botones de la interfaz de usuario no responden por completo mientras se ejecuta la función testIntervalAsync, pero, curiosamente, el componente ScrollView anidado responde perfectamente al tacto (todavía se puede desplazar).

Soy bastante nuevo en reaccionar de forma nativa, entonces, ¿alguien podría darme una idea de por qué funciona tan lentamente?

 const TestScreen = ({}: TestScreenProps) => { ... useEffect(() => { const interval = setInterval( async () => { testIntervalAsync (); }, 1000); const testIntervalAsync = async () => { for(let i = 0; i < 5000; i++ ) console.log("Test interval: ", i); }; return (() => { clearInterval(interval); }) }, []); return ( <Box> ... <ScrollView> ... </ScrollView> ... </Box> ); };
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!