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
Create a Component that uses react-router functionality (In a Outsource library)
Config project to work in react-router
Wrapped it with a HashRouter
Use the Component (React project)
Run it
Failed to run, Error in the console of 'useLocation() may be used only in the context of a component.'
Expected Behavior
The Outsource Component should 'know' about the parent HashRouter wrapper, and not fail to run.
Actual Behavior
Right now throw an exception.
If I wrap the library and the project in 2 HashRouter (One for each one), it can run (What it is not supposed to), but a kind of weird behavior happened (With the state of the URL params)
** Only one instance of the library
The text was updated successfully, but these errors were encountered:
This is likely something with how the app is being built and bundled, resulting in two instances of the library. Separate instances of some key internal variables is the reason you would get this message, so something about your build process is likely resulting in this. This isn't a bug in the library.
What version of React Router are you using?
6.26.0
Steps to Reproduce
Create a Component that uses react-router functionality (In a Outsource library)
Config project to work in react-router
Wrapped it with a HashRouter
Use the Component (React project)
Run it
Failed to run, Error in the console of 'useLocation() may be used only in the context of a component.'
Expected Behavior
The Outsource Component should 'know' about the parent HashRouter wrapper, and not fail to run.
Actual Behavior
Right now throw an exception.
If I wrap the library and the project in 2 HashRouter (One for each one), it can run (What it is not supposed to), but a kind of weird behavior happened (With the state of the URL params)
** Only one instance of the library
The text was updated successfully, but these errors were encountered: