Hi there,
We’re migrating to v6.4 and using the new createBrowserRouter instead of BrowserRouter. Specifically we’re using createRoutesFromElements
as suggested by the docs to migrate our routes to the new createBrowserRouter
router.
Our setup looks something like this
const router = createBrowserRouter(
createRoutesFromElements(--> our routes go here <--)
);
root.render(
<React.StrictMode>
<ChakraProvider theme={theme}>
<RouterProvider router={router} />
</ChakraProvider>
</React.StrictMode>
);
Auth0 docs say that the Auth0 provider should be nested under the provider. How could this be done with the new router?
We’ve tried wrapping the Auth provider around the Routes in createRoutesFromElements
but doesn’t work. Also tried to do this but we get an error.
<RouterProvider router={router} >
<Auth0Provider />
</RouterProvider>
Can someone please help me understand where to place the Auth0 provider? Thank you