Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript error on tabNavigator #260

Open
titicarabina opened this issue Apr 16, 2024 · 6 comments
Open

Typescript error on tabNavigator #260

titicarabina opened this issue Apr 16, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@titicarabina
Copy link

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
Copy link
Author

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

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

@danstepanov
Copy link
Collaborator

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

@titicarabina
Copy link
Author

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
Copy link
Collaborator

@titicarabina
Copy link
Author

great , will do , Thanks!

@danstepanov danstepanov added the bug Something isn't working label Jun 11, 2024
1NoobDev added a commit to 1NoobDev/create-expo-stack that referenced this issue Jul 22, 2024
Fix Typescript error on tabNavigator roninoss#260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants