Provides location context for the rest of the app.
Note: You usually won't render a <Router>
directly. Instead, you'll render a
router that is more specific to your environment such as a <BrowserRouter>
in web browsers or a <StaticRouter>
for server rendering.
function Router({ basename: basenameProp = "/", children = null, location: locationProp, navigationType = NavigationType.Pop, navigator, static: staticProp = false, }: RouterProps): React.ReactElement | null
The base path for the application. This is prepended to all locations
Nested Route
elements describing the route tree
The location to match against. Defaults to the current location.
This can be a string or an object with pathname
, search
, hash
, state
, and key
.
The type of navigation that triggered this location change.
Defaults to NavigationType.Pop
.
The navigator to use for navigation. This is usually a history object
or a custom navigator that implements the Navigator
interface.
Whether this router is static or not (used for SSR). If true
, the router
will not be reactive to location changes.