Components

Route

Edit this page

Route 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.

Multiple paths

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.

proptypedescription
pathstring | string[]Path partial for defining the route segment
componentComponentComponent that will be rendered for the matched segment
matchFiltersMatchFiltersAdditional constraints for matching against the route
childrenJSX.ElementNested <Route> definitions
preloadRoutePreloadFuncFunction called during preload or when the route is navigated to.
Report an issue with this page