Route
Edit this pageRoute
is the component used when defining the routes of an application.
This component is used to define the structure of the application and the components that will be rendered for each route.
Routes support defining multiple paths using an array. This is useful for when you want a route to remain mounted and not re-render when switching between two or more locations that it matches:
<Route path={["/login", "/register"]} component={Login} />
This would mean navigating from /login
to /register
would not cause the Login
component to re-render.
path
Type: string | string[]
Path partial for defining the route segment.
component
Type: Component
Component that will be rendered for the matched segment.
matchFilters
Type: MatchFilters
Additional constraints for matching against the route.
children
Type: JSX.Element
Nested <Route>
definitions.
preload
Type: RoutePreloadFunc
Function called during preload or when the route is navigated to.