Skip to content

How can i use BrowserRouter basename in RouterProvider from v6.4? #9481

Closed Answered by brophdawg11
nihil-pro asked this question in Q&A
Discussion options

You must be logged in to vote

You can provide a basename to createBrowserRouter:

let router = createBrowserRouter(routes, { basename: "/base" })

function App() {
  return <RouterProvider router={router} />
}

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@nihil-pro
Comment options

@brophdawg11
Comment options

@MiteshDarda
Comment options

@brophdawg11
Comment options

@dreygur
Comment options

Answer selected by brophdawg11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants