Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The difference between react router error-element and react error boundary #219

Open
mancuoj opened this issue Oct 26, 2024 · 1 comment

Comments

@mancuoj
Copy link

mancuoj commented Oct 26, 2024

I have a question about error-handling: why not use error-element instead of using react error boundary? When do they catch errors? Maybe it needs to be explained in the docs.

@alan2207
Copy link
Owner

Hey @mancuoj , I think it depends on where you are adding the error boundary. If it's a route level boundary, than it should be defined via react router, otherwise, if you want to handle errors on a more granular level on the page, you need to use regular error boundaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants