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.37k stars 77 forks source link

Fix TypeScript Error with TabNavigator in Drawer Navigation #260 #377

Closed 1NoobDev closed 3 weeks ago

1NoobDev commented 1 month ago

Description

This PR addresses the TypeScript error encountered in drawer-navigator.tsx when assigning the TabNavigator component to a Drawer.Screen. The error was due to a type mismatch between the expected ScreenComponentType for the component prop and the actual type of TabNavigator. To resolve this, we explicitly cast TabNavigator to React.ComponentType, bypassing the strict type checking while maintaining functionality.

Additionally, this PR addresses an issue where using a different name for the TabNavigator in Drawer.Screen would result in a type error. Ensuring the name matches the component resolves this issue.

Related Issue

This PR fixes the issue reported in #260 regarding a TypeScript error with TabNavigator.

How Has This Been Tested?

danstepanov commented 3 weeks ago

closing due to inactivity