0

在做一个 react-lite 项目时,我还安装了 react。想要在点击按钮时使用 react-modal 创建一个窗口。不能工作。

错误是未捕获类型错误:无法读取未定义的属性“ReactCurrentOwner”。

我尝试重新安装 node_modules,然后 npm 安装,更新,不工作。Package.json:

"devDependencies": {
    "babel-core": "^6.25.0",
    "babel-loader": "^7.0.0",
    "babel-plugin-transform-react-jsx": "^6.24.1",
    "babel-preset-env": "^1.5.2",
    "chrome-remote-interface": "^0.25.5",
    "compression-webpack-plugin": "~1.0.0",
    "copy-webpack-plugin": "~3.0.1",
    "css-loader": "^0.28.11",
    "eslint": "^3.19.0",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-react": "~6.9.0",
    "extract-text-webpack-plugin": "^2.1.0",
    "htmlparser": "^1.7.7",
    "jed": "^1.1.1",
    "jshint": "^2.9.5",
    "jshint-loader": "^0.8.4",
    "less": "^3.8.0",
    "less-loader": "^4.1.0",
    "po2json": "^0.4.5",
    "sass-loader": "^7.0.3",
    "sizzle": "^2.3.3",
    "stdio": "^0.2.7",
    "webpack": "^2.6.1"
  },
  "dependencies": {
    "bootstrap": "^4.1.1",
    "bootstrap-less": "^3.3.8",
    "exenv": "^1.2.2",
    "jquery": "^3.3.1",
    "moment": "^2.22.2",
    "node-sass": "^4.9.0",
    "patternfly": "^3.52.2",
    "prop-types": "^15.6.2",
    "react": "^16.0.0",
    "react-addons-css-transition-group": "^15.6.2",
    "react-addons-transition-group": "^15.6.2",
    "react-dom": "^16.0.0",
    "react-lite": "^0.15.38",
    "react-modal": "^2.2.2",
    "reactstrap": "^6.3.0",
    "strict-loader": "^1.2.0"
  }
}
4

1 回答 1

0

我看到你正在使用 React 16.x。

在此处查看 react-lite NPM 页面

注意:react-lite 现在不支持 React v16.x。

这可能是你的问题。

我不知道你的项目的范围,或者你想要完成什么,但你可能会发现Preact是一个不错的选择。

于 2018-07-23T19:28:29.813 回答