React Router v6.8.1 #10126
Replies: 2 comments 1 reply
-
Why not switch the order? <CustomContextProvideR>
<RouterProvider router={router} />
</CustomContextProvider> Also this should be in RR repository, not in Remix. |
Beta Was this translation helpful? Give feedback.
-
Coming from v5 where you're able to do that, it can prove challenging to migrate to the newer version on an actual production application, especially if a specific provider above your I believe what you want to do is export your router from your 'routing' file. export const router = createBrowserRouter(createRoutesFromElements(_ROUTES_HERE_)) next in your top level Provider.. import { router } from "_your_routing_file_";
// .. some component
// ..
.then((url) => {
router.navigate(url)
}) It doesnt seem to bring any issues to the application using it in this way since only one BrowserRouter is allowed within the application. I would probably avoid using syntax like Hopefully this helps! |
Beta Was this translation helpful? Give feedback.
-
How to wrap RouteProvider (data router) around my own ContextProvider, for example ModalContext.
I cannot wrap layout element in the routes since I have couple of different outlets (login page, protected pages)
Beta Was this translation helpful? Give feedback.
All reactions