react-native - createNavigatorFactory 不是函数

标签 react-native npm expo

我正在使用 Expo 开发我的 React 原生应用程序,我想开始使用使用选项卡的导航。

我使用 npm 安装了它,现在出现了这个问题。
enter image description here

这是我的 package.json :

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@react-native-community/masked-view": "0.1.5",
    "@react-navigation/bottom-tabs": "next",
    "@react-navigation/stack": "^5.0.0-alpha.63",
    "expo": "~36.0.0",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
    "react-native-gesture-handler": "~1.5.0",
    "react-native-reanimated": "~1.4.0",
    "react-native-safe-area-context": "0.6.0",
    "react-native-screens": "2.0.0-alpha.12",
    "react-native-web": "~0.11.7",
    "react-navigation": "^4.1.0"
  },
  "devDependencies": {
    "babel-preset-expo": "~8.0.0",
    "@babel/core": "^7.0.0"
  },
  "private": true
}

最佳答案

得到了同样的错误。解决了

yarn add @react-navigation/native@next

然后,您需要使用 NavigationNativeContainer 包装您的应用,如 in the docs (at the end) 所述

关于react-native - createNavigatorFactory 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60021360/

相关文章:

ios - 未找到 ios 的 React native 基本 header

ios - React native - 如何实现 iOS 设置

javascript - React Navigation header onPress - this.setState 不是一个函数

node.js - yarn 全局添加 <package> 给出错误 "couldn' t 在 npm 注册表上查找包”

react-native - 如何在不使用expo xde的情况下发布expo应用程序

react-native - 运行 expo start 后出现错误

javascript - 将 JavaScript NPM 包与导入一起使用

node.js - 在 ubuntu 上安装 towerjs 时遇到问题

javascript - 重新安装后Expo找不到模块

ios - React Native 中的 Fetch(或 Axios)不适用于 iOS 应用程序的博览会