Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
React Native Async Interval Function Performance Issue

I have a react native component which is running an async function on an interval timer. When testing this on an old android phone I was surprised to see some serious performance issues.

Any buttons in the UI are completely unresponsive whilst the testIntervalAsync function is running, but oddly the nested ScrollView component is perfectly responsive to touch (it can still be scrolled).

I'm fairly new to react native, so would anyone be able to give any insight into why it runs so slowly?

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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda