You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicit error on <Route> outside <Router> (remix-run#4939)
* Explicit error on <Route> outside <Router>
When using <Route> outside a valid <Router>, the message is not that explicit. It throws:
`Cannot read property 'route' of undefined`
Even though it's not that bad, I propose we make it even more explicit. Can't be bad to know where the error is coming from. If you made a typo when importing the router, it's not obvious otherwise.
This will throw an error rather than a warning because the library code would crash otherwise.
* Add unit test
* Fix unit test change
* Add router check before first usage on <Router />
* Switch throw to invariant for <Router> check
* Add <Router> check on <Link>, <Switch>, <Redirect>, <Prompt>
0 commit comments