Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Am not understanding what is missing for TypeScript Drawer component

$
0
0

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


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>