useRoutes
useRoutes(routes: RouteObject[],locationArg: string | Partial<Location>): React.ReactElement | null
Returns the element of the route that matched the current location, prepared
with the correct context to render the remainder of the route tree. Route
elements in the tree must render an <Outlet> to render their child route's
element.
Properties
(Mandatory properties are in bold)Properties | Type | Description |
---|---|---|
routes | RouteObject[] |
Additional properties for advanced use cases
Properties | Type | Description |
---|---|---|
locationArg | string | Partial<Location> |