Authentication with new createBrowserRouter failed with Context API, but working fine with BrowserRouter #9927
Unanswered
shrijan00003
asked this question in
Q&A
Replies: 2 comments
-
@whtjs @Vanilla2 Any suggestions? Is this the bug or I am missing something? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Struggling with something similar. Changing the custom context in the Auth Provider is not passing to other routes, only the one route that changes it (e.g., '/login'). The upated context only propogates if I navigate using the UI, but if I try to navigate by changing the URI directly, the custom context reverts to its original state... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have tried to implement authentication with the new
createBrowserRouter
API with context API, which seems to have weird behaviors, not sure whether the issue is with the implementation or with API.Please check both examples:
Working example with BrowserRouter: https://stackblitz.com/edit/react-ts-jiaksh?file=App.tsx
(Not working) Example with
createBrowserRouter
: https://stackblitz.com/edit/react-ts-qjrtdp?file=App.tsxBeta Was this translation helpful? Give feedback.
All reactions