react-native-android - 在Android后退按钮后重新打开应用程序时呈现导航器初始路线
问题描述
我在 ScreenA 上。当我按下 Android 后退按钮时,应用程序关闭(确定)。当我重新打开它时,我的 Root 导航器的“初始路线”被挂载(SplashScreen),它实际上运行 Bootstrap 并且发生了不好的事情。如果我在 ScreenA 上,只需按下 Android 主页按钮,然后返回,就可以了 - 我仍在 ScreenA 上,并且未呈现初始路线。知道为什么在 Android 硬件按下后会安装初始路由吗?
在我的配置下面:
export const MyRootStack = createStackNavigator<IRootStackNavigationParamList>();
function RootStackScreen() {
return (
<MyRootStack.Navigator
initialRouteName={RouteNames.SplashScreen}
headerMode={"none"}
>
<MyRootStack.Screen
name={RouteNames.SplashScreen}
component={RootSplashScreen}
/>
<MyRootStack.Screen
name={RouteNames.LoginScreen}
component={LoginScreen}
options={{ cardStyleInterpolator: forFade }}
/>
<MyRootStack.Screen
name={RouteNames.ScreenA}
component={ScreenAStack}
options={{ cardStyleInterpolator: forFade }}
/>
</MyRootStack.Navigator>);
}
export const MyNavigationContainer: React.FC<{}> = RootStackScreen; // typing as React.FC to be able to render as JSX
任何建议都非常感谢,非常感谢!
解决方案
推荐阅读
- reactjs - Microblink SDK:只拍摄矩形内的照片
- html - 我似乎无法弄清楚我做错了什么,我的悬停在我的网站上不起作用
- c - C在短路表达式中对同一变量进行多次赋值
- ios - 以编程方式为以编程方式制作的 UITextField 创建约束
- php - 如何一次杀死多个 laravel php artisan 命令?
- jenkins - Jenkins 的代理设置中缺少 WebSocket
- javascript - 为什么 '[' + array + ']' 返回一个普通数组?
- makefile - 将路径组合到makefile中的文件名数组
- amazon-web-services - 当我尝试将 lambda 函数集成到 AWS 的 API 网关中时出现错误消息当我检查端点 URL 时
- go - Bufio 扫描功能正在等待 GO 中的最后一个缓冲区(尾操作)