Subscribe on changes!

Ignore unmounted component's errors in onErrorCaptured with Suspense

avatar
Feb 15th 2022

Version

3.2.31

Reproduction link

codesandbox.io

Steps to reproduce

Open the app. Click the Profile icon to go to the Profile route. Click the Dashboard icon & quickly click on the Profile icon again.

What is expected?

Render the Profile route as it's not throwing any error.

What is actually happening?

Dashboard emits an error even though the component is not mounted anymore, preventing the Profile route to be rendered.


Not sure if there is a way in onErrorCaptured to compare the component throwing the error & the current component?