-
Notifications
You must be signed in to change notification settings - Fork 97
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
Uncaught TypeError: Cannot destructure property 'navigator' of '(0 , import_react.useContext)(...)' as it is null. #271
Comments
I bmped into the same issue. Ensuring the My solution was this:
|
This is so weird. Even moving my routes to use |
Ok. Now it worked specifically with the version of |
For your reference, I use react-router(-dom) `6.14.0'. |
So when I used |
I used use-query-params with createBrowserRouter.
and I get same problems after that |
I've tried changing versions of react-router-dom and unfortunately it didn't change anything for me |
Anyone else having this issue? The last version of react-router / react-router-dom that doesn't seem to have the issue is I'm using a MemoryRouter. |
In my case I just needed <OutletWrapper>
<QueryParamProvider adapter={ReactRouter6Adapter}>
<Outlet />
</QueryParamProvider>
</OutletWrapper> |
Just to confirm, im not having any issues anymore, might have been a |
A workaround for me was to just copy the whole adapter code since the dependencies is quite small and by co-locating it on the same file as the provider, the error doesn't throw |
Description
I'm using React 18 with node 18 too (I have tried with 16 and 17 versions too). When using the
ReactRouter6Adapter
I'm getting this error:Uncaught TypeError: Cannot destructure property 'navigator' of '(0 , import_react.useContext)(...)' as it is null.
Versions:
node: v18.16.1
react: ^18.2.0
react-router-dom: ^6.14.1
use-query-params: ^2.2.1
I've reinstalled everything, cleared cache... I tried creating a reproducible environment, but it worked fine there. So am I missing something here?
The text was updated successfully, but these errors were encountered: