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

232
Views
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
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!