我已经创建了启动画面和登录画面。我希望 2 秒后我的屏幕开始启动,但它显示:undefined is not an object(evaluating
'_this.props.navigation.push ')
在这个项目中我使用的是react-navigation
componentWillMount(){
setTimeout(
() => {
this.props.navigation.push({
screen:'smartbill.login',
title:'LOGIN SCREEN'
});
}
, 1000);
最佳答案
希望你已经创建了一个堆栈导航器
const App = createStackNavigator({
Splash: { screen: SplashScreen },
Login: { screen: LoginScreen },
});
在启动画面中
setTimeout(()=> {
navigate('Login', { name: 'Jane' })
},1000);
关于react-native - 将导航启动画面 react 到登录屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53113429/