FrontendDeveloper.in

React question detail

What are the `<Router>` components of React Router v6?

React Router v6 provides below 4 <Router> components:

  1. <BrowserRouter>:Uses the HTML5 history API for standard web apps.
  2. <HashRouter>:Uses hash-based routing for static servers.
  3. <MemoryRouter>:Uses in-memory routing for testing and non-browser environments.
  4. <StaticRouter>:Provides static routing for server-side rendering (SSR).

The above components will create browser, hash, memory and static history instances. React Router v6 makes the properties and methods of the history instance associated with your router available through the context in the router object.

Back to all React questions
Get LinkedIn Premium at Rs 399