Closed
Description
Problem Statement
React Router 6.4 introduced Data API, with 3 new ways to initialize a router:
createBrowserRouter
: feat(react): Add tracing support for React Router 6.4createBrowserRouter
. #6172createMemoryRouter
also covered by feat(react): Add tracing support for React Router 6.4createBrowserRouter
. #6172- and
createHashRouter
We should support usage of createHashRouter
for users that prefer it over createBrowserRouter
.
Solution Brainstorm
Implementation should be fairly similar to createBrowserRouter
, we should still be able to subscribe routing events.
Also need to check:
- How would route parameterization work with hash urls?
- Do we need a URL parser, or can we get declarative route info from subscription?
Alternatively we can also consider writing a wrapper for <RouterProvider>
, which all three types of routers are rendered in.