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

231
Visualizações
I expect to get an error when I close(unmout) a component that fetchs data

I'm learning in 'The Net Ninja' about routes and navigating between the pages.

In there a component does data fetching and if we navigate(from the Home page) to another page(New Blog), before completing fetch, it gives an error. (Can't perform a state updating over an unmounted component).

enter image description here

So used an Abort Controller and cleanup function to fix it (To stoping fetching after unmounting the component).

But I don't get any error even without using from Abort Controller and cleanup function. So why?

1- please navigate to New Blog

2- Then navigate to Home

3- Then Quickly navigate to New Blog again. (before loading data)

This should give the above error.

Is it for a different versions? In there: RRD: 5.2.0 && react: 17.0.1 and for me: RRD: 5.3.3 && react: 18.1.0

It's project: https://codesandbox.io/s/complete-react-tutorial-forked-c7onv3

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