react-navigation.github.io icon indicating copy to clipboard operation
react-navigation.github.io copied to clipboard

How to add type annotaion for custom header props.

Open The-White-Fang opened this issue 2 years ago • 0 comments

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?

The-White-Fang avatar Mar 05 '22 18:03 The-White-Fang