Return the navigation object for the current route.
It takes an optional argument named parent
of type string
:
parent
- Provide an absolute path like /(root)
to the parent route or a relative path like ../../
to the parent route.It returns the result of useNavigation
from React Navigation, you can see the methods available on this object on the React Navigation navigation prop reference page.
You should prefer to use useRouter
as it is strongly typed and only exposes functions that are guaranteed to work within One, but useNavigation gives you lower level access to the underling React Navigation instance.
Edit this page on GitHub.