I am creating a custom drawer content using this guide:
const DrawerContent = (props) => (
<DrawerContentScrollView {...props}>
<AntDesign
name="close"
size={32}
onPress={() => props.navigation.closeDrawer()}
/>
<Text>TEST</Text>
<DrawerItemList {...props} />
</DrawerContentScrollView>
);
It works well, but I would like type checking on the props
parameter. So I tried:
import { DrawerContentComponentProps } from '@react-navigation/drawer';
const DrawerContent = (props: DrawerContentComponentProps) => (
// Same stuff
);
But my IDE is now telling me that props.navigation.closeDrawer
does not exist, but it does.
What is the correct way to define the props
type of the DrawerContent
function?