我想使用的反应导航3.x结合反应-本机网页。通过通过"开始"-steps,
只需进口:
import { createStackNavigator, createAppContainer } from "react-navigation";更新babel配置后,我最终会收到以下错误:
找不到./node_modules/@react-navigation/native/node_modules/react-native-gesture-handler/Swipeable.js模块:无法在'D:\react_native\App\app\node_modules@react-navigation\native\node_modules\react-native-gesture-handler‘中解析'react-native/Libraries/Animated/src/AnimatedEvent’
在我的研究中,我在github上发现了一些可能与错误有关的主题:https://github.com/kmagiera/react-native-gesture-handler/pull/406
https://github.com/react-navigation/react-navigation/issues/5632
我已经使用这个“修复”(从上面的github拉)作为依赖:
"react-native-gesture-handler": "jaulz/react-native-gesture-handler#fix/web-compatibility"但同样的错误是:
找不到./node_modules/@react-navigation/native/node_modules/react-native-gesture-handler/DrawerLayout.js模块:无法在'D:\react_native\App\app\node_modules@react-navigation\native\node_modules\react-native-gesture-handler‘中解析'react-native/Libraries/Animated/src/AnimatedEvent’
如何在web上使用react导航实现工作导航?也许会使用其他的依赖版本?还是应该使用react路由器呢?
发布于 2019-07-09 04:32:38
以下是一些为web应用程序设置反作用力导航的说明。https://reactnavigation.org/docs/en/web-support.html
简言之:
yarn add @react-navigation/core yarn add @react-navigation/web
然后
import { createSwitchNavigator } from "@react-navigation/core"; import { createBrowserApp, Link } from "@react-navigation/web";
最后替换createAppContainer wIth createBrowserApp
https://stackoverflow.com/questions/54970760
复制相似问题