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

114
Visualizações
navigation.addListener didFocus error when saving file in react native app

I am using the code below to reload a screen when each time it's in focus. This works fine except when I make changes to the file during development then I get the error shown below the code example. Not sure if this matters since I won't be saving the file while people are actually using the app. Can't see pushing this out into production though with this issue, any help would be appreciated.

this.focusListener = navigation.addListener('didFocus', () => {

    fetchData();

});

Error message when saving file in development:

TypeError: undefined is not an object (evaluating '_this.focusListener = navigation.addListener('didFocus', function () {
        fetchData();
      })')

My app completely blows up and I have to reload it. Using Expo if that matters.

Also shows this error:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
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