Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How can I access params in next navigation

$
0
0

I work with Typescript and I have simple navigation:

function go_to_screen(rout_name:string,device_model:string){  avis_instance.save_data('main_model', device_model);  navigation.navigate(rout_name,{ name: device_model });}

and then, on the next navigation I cannot access to name param via:

route.params.name or params.name ...

How can do this? Thanks!

P.S:here is component in next view : I generated it via default init expo .you can see what and how access to it .do you have any idea ?

export default function BottomTabNavigator() {  const colorScheme = useColorScheme();  return (<BottomTab.Navigator      initialRouteName="TabOne"      tabBarOptions={{ activeTintColor: Colors[colorScheme].tint }}><BottomTab.Screen        name=" "        component={TabOneNavigator}      /></BottomTab.Navigator>  );}const TabOneStack = createStackNavigator<TabOneParamList>();function TabOneNavigator() {  console.log("moziii"+route.params.name );  return (<TabOneStack.Navigator><TabOneStack.Screen        name="TabOneScreen"        component={TabOneScreen}        options={{ headerTitle: 'Anik' ,        headerStyle: {          backgroundColor: '#034ea2',        },        headerTintColor: '#fff',        headerTitleStyle: {          fontWeight: 'bold',        },      }}      /></TabOneStack.Navigator>  );}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>