【发布时间】:2021-01-28 08:09:09
【问题描述】:
我不知道该怎么做我已经尝试过堆栈导航器,道具也有同样的问题;/
进入屏幕
...
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>
);
}...
导航
...
const SwitchNavigation = createStackNavigator({
Enter:{screen : EnterScreen},
Home:{ screen :HomeScreen}
})...
export default createAppContainer(SwitchNavigation);
应用程序
...
export default function App(props) {
return (
<NavigaitonScreens />
);
}...
【问题讨论】:
标签: react-native react-navigation react-navigation-stack