import * as React from "react" ; export function getNavigator ( name ) { if ( name === "bottom-tabs" ) return require ( "@react-navigation/bottom-tabs" ) . createBottomTabNavigator ; if ( name === "drawer" ) return require ( "@react-navigation/drawer" ) . createDrawerNavigator ; if ( name === "stack" ) return require ( "@react-navigation/stack" ) . createStackNavigator ; if ( name === "native-stack" ) return require ( "@react-navigation/stack" ) . createStackNavigator ; if ( name === "native-stack" ) return require ( "react-native-screens/native-stack" ) . createNativeStackNavigator ; throw new Error ( "unknown navigator type: " + name ) ; } export function useNavigator ( name ) { return React . useMemo ( ( ) => { console . log ( getNavigator ( name ) ) ; return getNavigator ( name ) ( ) ; } , [ name ] ) ; }