useNavigationType返回用户到达当前位置时使用的导航类型。
import { useNavigationType } from "@remix-run/react";
function SomeComponent() {
const navigationType = useNavigationType();
// ...
}
<Link replace> 的链接,提交带有 <Form replace> 的表单,或调用 navigate(to, { replace: true }) 等。navigate(-1) 或 navigate(1) 等。