I am new to TypeScript and have been trying to learn as I continue to build an application.
The error I am seeing within VSCode is:
Type '{ state: DrawerNavigationState<ParamListBase>; navigation: DrawerNavigationHelpers; descriptors: DrawerDescriptorMap; }' has no properties in common with type 'IntrinsicAttributes'.ts(2559)
This error appears from CustomDrawerContent
The way my code is currently implemented is:
const Drawer = createDrawerNavigator<RootDrawerParamList>();const CustomDrawerContent = () => { return (<SafeAreaView><Text>Hellow</Text></SafeAreaView> );};const DrawerNavigation = () => { return (<Drawer.Navigator drawerContent={(props) => <CustomDrawerContent {...props} />}><Drawer.Screen name="RootDrawer" component={LandingStackNavigation} /></Drawer.Navigator> );};export default DrawerNavigation;
The type I created for this was RootDrawerParamList
. Which is:
export type RootDrawerParamList = { RootDrawer: DrawerScreenProps<LandingStackParamList>;};
What am I missing about this one? Thank you for helping me understanding how I should approach this type of error