undefined 不是一个函数(评估属性[typeof Symbol === "function"?Symbol.iterator:"@@iterator"]()') React Native

2024-04-17

以前运行良好,但在更新一些项目依赖项后突然出现此错误。它来自渲染的组件slate.js对象(我不是渲染编辑器而是渲染文本)。我读到这个错误可以通过更新来解决babel-preset-react-native,但我的已经是最新的了。我也导入过babel-polyfill在入口文件中。

我在github上发现了很多这样的问题,但没有找到适合我的解决方案。

包.json

{
  "name": "mobile",
  "version": "0.0.1",
  "dependencies": {
    "antd-mobile": "^2.1.6",
    "babel-polyfill": "^6.26.0",
    "react": "16.2.0",
    "react-native": "^0.49.0",
    "react-native-navigation": "^1.1.375",
    "slate": "^0.32.4"
  },
  "devDependencies": {
    "babel-jest": "^22.2.2",
    "babel-plugin-import": "^1.6.3",
    "babel-preset-react-native": "^4.0.0",
    "jest": "^22.2.2",
    "react-native-dotenv": "^0.1.1",
    "react-test-renderer": "^16.2.0"
  },
  "jest": {
    "preset": "react-native"
  }
}


{
  "presets": ["react-native","react-native-dotenv"],
  "plugins": [["import", { "libraryName": "antd-mobile" }]]
}

我在应用程序中使用打字稿,这是 tsconfig.json

{
    "compilerOptions": {
        "module": "es2015",
        "target": "es2015",
        "moduleResolution": "node",
        "outDir": "./src",
        "experimentalDecorators": true,
        "noLib": false,
        "declaration": false,
        "emitDecoratorMetadata": true,
        "lib": ["es6", "dom"],
        "types": ["system","node"],
        "jsx": "react"
    },
    "exclude": [
        "node_modules"
    ]
}

None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

undefined 不是一个函数(评估属性[typeof Symbol === "function"?Symbol.iterator:"@@iterator"]()') React Native 的相关文章

随机推荐