-
Notifications
You must be signed in to change notification settings - Fork 30
[QoL] Warn on missing react-router context #4
Comments
What version of |
The version I am using is To clarify; I have a test in which I was testing a component that uses the
Therefore it gave me the aforementioned error:
Which got me confused for a bit why it would not unpack { history }. Of course it made sense after thinking about it, and I came to the conclusion that I was missing the
Sorry for doing a poor job of explaining in my original comment. Merry christmas! |
Gotcha. An error message for this scenario should be deployed in |
I am getting an error:
Using next versions of react-router, react, & react-dom. here is a codesandbox. |
Can you provide the specific version number of react-router as listed in your package.json file? |
Hmm. In the codesandbox it's not working (same problem that I originally had), but if I download it and install/run it locally it does. I used |
When testing one of my components that uses the useReactRouter hook, I got the following error:
The error itself is a bit ambiguous as it originates from the hook not being able to find the React-Router context. Perhaps a nice addition would be to warn/error on not being able to find the React-Router context.
The text was updated successfully, but these errors were encountered: