当前行为获取错误
react native中的Private Route在页面变化时无法使用。任何导航器都无法处理带有有效载荷{"name": "Home"}的动作'NAVIGATE'。
如果您试图导航到嵌套导航器中的一个屏幕,请参见 https:/reactnavigation.orgdocsnesting-navigators#navigating-to-a-screen-in-nested-navigator.
这是一个仅用于开发的警告,不会在生产中显示。
如何重现使用的代码来自.NET Framework 2.0。https:/reactnavigation.orgdocsauth-flow。
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerShown: false,
}}>
{isSignedIn === "true"? (
<>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Bookorder" component={Bookorder} />
</>
) : (
<>
<Stack.Screen name="Login" component={Login} />
</>
)}
</Stack.Navigator>
</NavigationContainer>
环境系统:OS: macOS 10.15.4CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHzMemory: 46.17 MB 8.00GBShell: 3.2.57 - binbashBinaries:Node: 13.12.0 - usrlocalbinnodeYarn: Not Foundnpm: 6.14.4 - usrlocalbinnpmWatchman: 4.9.0 - usrlocalbinwatchman.