useRoute is a hook which gives access to
route object. It's useful when you cannot pass the
route prop into the component directly, or don't want to pass it in case of a deeply nested child.
useRoute() returns the
route prop of the screen it's inside.
See the documentation for the
route prop for more info.
Using with class component
You can wrap your class component in a function component to use the hook: