Programmatic Navigation
Learn how to trigger navigation imperatively from event handlers or effects using React Router's useNavigate hook.
While <Link> handles declarative, user-clicked navigation, many situations require triggering navigation imperatively from code — after a form successfully submits, after a timed redirect, or in response to some business logic decision. React Router's useNavigate() hook returns a function you call with a path (or a delta like -1 for 'go back') to perform that navigation from inside an event handler or effect.
Programmatic navigation is like a receptionist who, instead of waiting for a visitor to walk up and ask for a room, proactively buzzes them through to a different room based on some internal decision (like confirming their appointment succeeded), while still using the exact same door system (browser history) as if the visitor had walked there themselves.