Navigate
On this page

Navigate

Summary

Reference Documentation ↗

A component-based version of useNavigate to use in a React.Component class where hooks cannot be used.

It's recommended to avoid using this component in favor of useNavigate.

<Navigate to="/tasks" />

Signature

function Navigate({ to, replace, state, relative }: NavigateProps): null

Props

relative

How to interpret relative routing in the to prop. See RelativeRoutingType.

replace

Whether to replace the current entry in the History stack

state

State to pass to the new Location to store in history.state.

to

The path to navigate to. This can be a string or a Path object

Docs and examples CC 4.0
Edit