useNavigate
Edit this pageRetrieves the method which accepts a path to navigate to and an optional object with the following options:
- resolve (boolean, default
true
): resolve the path against the current route - replace (boolean, default
false
): replace the history entry - scroll (boolean, default
true
): scroll to top after navigation - state (any, default
undefined
): pass custom state tolocation.state
If you are inside of a cache
or action
function you will instead want to use redirect or reload.
Info:
The state is serialized using the structured clone algorithm which does not support all object types.