I have route configuration with routes
from useRoutes()
hook which already works properly
<HashRouter>
{routes}
<NavigationBar />
</HashRouter>
Now I have to migrate it to new createHashRouter()
. The problem is that, docs states that it has to be rendered like
<RouterProvider router={/* return value from createHashRouter */} />
leaving no way to render the <NavigationBar />
. Also the RouteProvider
doesn't accept any children if I try to render like
<RouterProvider router={/* return value from createHashRouter */} >
<NavigationBar />
</RouterProvider>
It throws Property 'children' does not exist on type 'IntrinsicAttributes & RouterProviderProps'
Another method
<main>
<RouterProvider ... />
<NavigationBar />
</main>
Here NavigationBar
doesn't have access to navigation properties like router hooks.
There is no mention in the docs to how to implement the above scenario