使用react-modal错误:未捕获的TypeError:无法读取未定义的属性'ReactCurrentOwner'

时间:2018-07-23 19:19:15

标签: reactjs modal-dialog react-modal

在一个react-lite项目上,我还安装了react。想要在单击按钮时使用react-modal创建窗口。无法工作。

错误未被捕获TypeError:无法读取未定义的属性'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"
  }
}

1 个答案:

答案 0 :(得分:0)

我看到您正在使用React16.x。

Check the react-lite NPM page here

  

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

这可能是您的问题。

我不知道您的项目范围或您要完成的工作,但是您可能会发现Preact是一个很好的选择。