react-router-guards
react-router-guards copied to clipboard
[Breaking] Use error object
trafficstars
Description
Previously, we only ever surfaced the error message. As pointed out by #44, we should return the full object instead of just the message! That way the user can have full context of their errors when rendering the error page
This is a breaking change and should be released with 2.0.0
Related issues
Builds on top of #84 to resolve #44
What this does
- Removes
RouteErrortype in favor ofunknown(since we don't know what kind of error is thrown!) - Update route error state management in
Guardcomponent - Updates intermediate demo + docs example to use
instanceof Errorcheck
How to test
- Visit a Missingno page on the deployed app (e.g.,
/test) - Confirm the error message still appears as expected