I'm getting the following typescript error - the code runs fine, just trying to figure out the ts issue:
Type '({ route, }: NativeStackScreenProps<NavigationStackParamsList, 'List'>) => React.JSX.Element' is not assignable to type 'ScreenComponentType<any, any> | undefined'. Type '({ route, }: NativeStackScreenProps<NavigationStackParamsList, 'List'>) => React.JSX.Element' is not assignable to type 'FunctionComponent<{}>'. Types of parameters '__0' and 'props' are incompatible. Type '{}' is missing the following properties from type 'NativeStackScreenProps<NavigationStackParamsList, "List">': navigation, routets(2322)
The ListItems screen is what is giving the error on my tab navigator.
Finally, my ListItems function declaration:
const ListItems = ({
route,
}: NativeStackScreenProps<NavigationStackParamsList, 'List'>) => {
From what I'm reading online, I would need to type my usage of createBottomTabNavigator similar to the way I typed my createNativeStackNavigator. I'm also fairly new to typescript, so any pointers or help on this would be helpful. Thanks.
I'm getting the following typescript error - the code runs fine, just trying to figure out the ts issue:
Type '({ route, }: NativeStackScreenProps<NavigationStackParamsList, 'List'>) => React.JSX.Element' is not assignable to type 'ScreenComponentType<any, any> | undefined'. Type '({ route, }: NativeStackScreenProps<NavigationStackParamsList, 'List'>) => React.JSX.Element' is not assignable to type 'FunctionComponent<{}>'. Types of parameters '__0' and 'props' are incompatible. Type '{}' is missing the following properties from type 'NativeStackScreenProps<NavigationStackParamsList, "List">': navigation, routets(2322)
My setup is as follows: My main stack navigator
My Tabs Navigator render:
The ListItems screen is what is giving the error on my tab navigator.
From what I'm reading online, I would need to type my usage of
createBottomTabNavigator
similar to the way I typed mycreateNativeStackNavigator
. I'm also fairly new to typescript, so any pointers or help on this would be helpful. Thanks.