Sunesimonsen
Add Navigate component
The <Navigate>
element changes the location to the given route when rendered. It's a component wrapper around the router.navigate
function
It accepts the same parameters as props.
Example usage:
<Navigate route="posts/new" />
<Navigate
route="posts/edit"
params={{ id: 42 }}
queryParams={{ showSettings: true }}
hash="#settings"
/>
Note this component's intended purpose is redirecting to default routes. See example Switch on the route name
Forked On 14 Mar 2023 at 10:27:45