gpt4 book ai didi

react-native - 将导航启动画面 react 到登录屏幕

转载 作者:行者123 更新时间:2023-12-04 14:22:14 25 4
gpt4 key购买 nike

我已经创建了启动画面和登录画面。我希望 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com