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.
https://rn.new
MIT License
1.34k stars 77 forks source link

Typescript error on tabNavigator #260

Open titicarabina opened 4 months ago

titicarabina commented 4 months ago

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.

titicarabina commented 4 months ago

I solved the issue by doing so in tab-nagivator.tsx

type Props = StackScreenProps<RootStackParamList, 'TabNavigator'> | any;

danstepanov commented 4 months ago

Thanks for flagging this! Would you like to submit a PR?

titicarabina commented 4 months ago

That would be nice if i can do it . It;s my first PR , can you guide me please? Thank you! Appreciate your work

danstepanov commented 4 months ago

@titicarabina this is the file you'll want to update https://github.com/danstepanov/create-expo-stack/blob/94601f1687fd0703c0a9b6e43239f971c9e85df6/cli/src/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs

danstepanov commented 4 months ago

and here's our contributor guide https://github.com/danstepanov/create-expo-stack/blob/main/contributing.md

titicarabina commented 4 months ago

great , will do , Thanks!