有了新的react导航v5,它就不可能与react-native-web一起使用了。仅仅导入createBrowserApp就会抛出错误 import {createBrowserApp} from "@react-navigation/web"; 在@反应导航/web/dist/Link.js中显示以下错误 TypeError: (0 , _core.withNavigation) is not a function 有没有人知道如何在react-native- v5中使用react导航web?我需要路径中的url历史,但现在它已经变得不可能了。
我使用的是react-native导航,并使用redux进行状态管理。当我使用"push“方法转到screenA to screenB时,screenA不会卸载。这将导致不必要的重新渲染,以前在react导航中,我使用shouldComponentUpdate将组件与当前可见的屏幕进行匹配,以停止重新渲染。
有没有办法在反应原生导航中做到这一点?
电流行为
执行应用程序后的没有安装reporting
bundling failed: Error: Unable to resolve module `
react-native-screens` from `node_modules/react-navigation-tabs/src/navigators/createBottomTabNavigator.js`: react-native-screens could not be found within the project.
您的环境
\##.软件##.#^#^
\x{e76f}反应-导航
\x{e76f}反应-原生- 0.61.
在我的App.js中,我调用了一个自定义。当我尝试使用自定义React导航到页面时,它会抛出一个错误:
Error: WithAuth(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
我知道这似乎是不言自明的,但我是新的反应。如果用户在尝试导航到仪表板页面时没有登录,我将尝试将用户重定向到登录页面。我知道在某个地方我需要返回null,但我不知道在哪里。任何帮助都会很棒。谢谢。
App.js
i
TypeError: (0, _$$_REQUIRE(_dependencyMap[1], "@react-navigation/native").usePreventRemoveContext) is not a function. (In '(0, _$$_REQUIRE(_dependencyMap[1], "@react-navigation/native").usePreventRemoveContext)()', '(0, _$$_REQUIRE(_dependencyMap[1], "@react-navigatio
删除用户令牌后,用户重定向到登录页。但是,如果我与其他用户登录,主页仍然显示前面的用户信息。
这是因为我没有刷新主页。如何重新初始化(?)主页手动在反应-导航?
MainPage(Logged in as 'matt') -> Logout -> LoginPage
-> (here I want to refresh MainPage so it can be loaded once new user login)
-> MainPage(Should be logged in as other user 'kobe')
MainP