-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: added key on error boundary #5084
Conversation
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @yurimutti, I tried to test your solution and I still get stuck on the error page. Could you tell me how did you test it?
Hi @thomtrp, off course!
|
Got it, thank you! I don't think this is what is expected there:
@lucasbordeau could you please have a look into this? I believe you had fixed something similar. Maybe you can provide hints for @yurimutti 🙏 |
Thanks, @thomtrp
"Once it's that state it's very annoying because it's impossible to access any page (reload button doesn't solve anything). I searched on react-error-boundary doc, forums and founded that we need passing a key to reset internal states.
I will appreciate this hints @lucasbordeau |
@yurimutti The SO post address a slightly different problem, here we want to reload the page when we click on the button, so the application gets a chance to have a correct state. We can create another LayoutErrorBoundary component with a LayoutErrorFallback. Also it would be interesting to have a second button to navigate to "main menu" in case the error gets triggered every time we reload a specific page. |
Closes #5027
With a key based on current location, the component can be resetting and the user continuing your journey on another routes.