Remix Logo
main
Branches
main (2.0.1)dev
Versions
2.0.11.19.3v0.21.0
useNavigation

useNavigation

This hook is simply a re-export of React Router useNavigation.

import { useNavigation } from "@remix-run/react";

function SomeComponent() {
  const navigation = useNavigation();
  navigation.state; // "idle" | "submitting" | "loading"
  navigation.location; // Location being navigated to
  navigation.formData; // formData being submitted
  navigation.formAction; // url being submitted to
  navigation.formMethod; // "GET" | "POST" | "PATCH" | "PUT" | "DELETE"
}

For more information and usage, please refer to the React Router useNavigation docs.

Docs and examples licensed under MIT