roninoss / create-expo-stack

CLI tool to initialize a React Native application with Expo. Provides options to include Typescript, file-based routing via Expo Router, configuration based routing via pure React Navigation, styling via Nativewind, Restyle, Unistyles, StyleSheets, or Tamagui, and/or backend as a service such as Firebase and Supabase.

Home Page:https://rn.new

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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;

commented

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

great , will do , Thanks!