useNavigate 的基于组件的版本,用于无法使用 hook 的 React.Component 类。
建议避免使用此组件,而应使用 useNavigate。
<Navigate to="/tasks" />
function Navigate({ to, replace, state, relative }: NavigateProps): null
如何解释 to 属性中的相对路由。请参阅 RelativeRoutingType。
是否替换 History 堆栈中的当前条目
要传递给新 Location 的状态,以存储在 history.state 中。
要导航到的路径。这可以是一个字符串或一个 Path 对象