Hooks
Content
React Native Navigation offers its own event handling using but for convenience it's advisable to use React Native Navigation Hooks.
It's already installed in this template.
Check it out how it works and what it offers.
Tip
When using navigation hooks don't use NavigationProvider
and withNavigationProvider
, better supply it with componentId
:
import { useNavigationComponentDidAppear } from 'react-native-navigation-hooks'
const ExampleScreen = ({ componentId }) => {
useNavigationComponentDidAppear(
(e) => {
console.warn(`${e.componentName} appeared`)
},
{ componentId }
)
return <Text>Example Screen</Text>
}