react-navigation.github.io
react-navigation.github.io copied to clipboard
How to add type annotaion for custom header props.
I have created a custom header for Drawer Navigator. I have used DrawerHeaderProps
for its prop type, but this does not give strict type-checking behavior like what we get when we use DrawerScreenProps<HomeDrawerParamList, 'Home'>
. I was unable to find any documentation for this particular thing. I thought about extending DrawerHeaderProps
with the navigation
property type as extended type of CompositeScreenProps
. Is it a good idea to do it this way? Or should I use the useNavigation
hook instead?