Typescript error on tabNavigator
titicarabina opened this issue · comments
I have installed a project with nativewind , firebase and drawer + tabs navigator , and on drawer-navigator.tsx there is a typescript error :
Type '({ navigation }: Props) => Element' is not assignable to type 'ScreenComponentType<ParamListBase, "TabNavigator"> | undefined'.
Type '({ navigation }: Props) => Element' is not assignable to type 'FunctionComponent<{}>'.
Types of parameters '__0' and 'props' are incompatible.
Type '{}' is missing the following properties from type 'Props': navigation, route
Also if you don't use the same name on the Drawer.Screen for TabNavigator it throws another error : Type '"Tabs"' is not assignable to type '"TabNavigator"'. , You can fix this by making sure the name is the same with the component.
I solved the issue by doing so in tab-nagivator.tsx
type Props = StackScreenProps<RootStackParamList, 'TabNavigator'> | any;
Thanks for flagging this! Would you like to submit a PR?
That would be nice if i can do it . It;s my first PR , can you guide me please? Thank you! Appreciate your work
and here's our contributor guide https://github.com/danstepanov/create-expo-stack/blob/main/contributing.md
great , will do , Thanks!