Skip to content

Is there a way to use use-query-param with React Router's v6.4 createBrowserRouter? #275

Closed Answered by sofia5
sofia5 asked this question in Q&A
Discussion options

You must be logged in to vote

This worked:

const queryParamProviderElement = (
  <QueryParamProvider
    adapter={ReactRouter6Adapter}
  >
  <Outlet />
  </QueryParamProvider>
)
 const router = {
    path: '*',
    element: queryParamProviderElement,
    children: [[
  { path: 'path1', Component: Component1 },
  { path: 'path2', Component: Component2 },
])

so it wasn't too complicated in the end

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sofia5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant