I dont know what to do here i've tried stack navigator also same issue with props ;/
Enter Screen
... export default function App(props) { return ( <View style={{flex:1 , justifyContent:'center', alignItems:'center'}}> <TouchableOpacity onPress={()=>{ console.log(props) this.props.navigation.navigate('Home') //this.props.navigation.dispatch(SwitchActions.jumpTo('Home')) } } > <Text>switch test</Text> </TouchableOpacity> </View> ); }...
Navigation
... const SwitchNavigation = createStackNavigator({ Enter:{screen : EnterScreen}, Home:{ screen :HomeScreen} })... export default createAppContainer(SwitchNavigation);
APP
... export default function App(props) { return ( <NavigaitonScreens /> ); }...
It has nothing to do with navigation.
There is No this in functional-component ...
this
access props directly like props.navigation.navigate('Home')
props
props.navigation.navigate('Home')
1.4m articles
1.4m replys
5 comments
57.0k users