Returns the current navigation, defaulting to an "idle" navigation when no navigation is in progress. You can use this to render pending UI (like a global spinner) or read FormData from a form navigation.
import { useNavigation } from"react-router"
functionSomeComponent() { letnavigation = useNavigation(); navigation.state navigation.formData // etc. }
Returns the current navigation, defaulting to an "idle" navigation when no navigation is in progress. You can use this to render pending UI (like a global spinner) or read FormData from a form navigation.