我对后端反应设置完全陌生。一切都很顺利,直到我开始造型......我得到了这个
TypeError: Cannot read property 'object' of undefined
./node_modules/radium/lib/components/style.js
node_modules/radium/lib/components/style.js:23
20 | displayName: 'Style',
21 |
22 | propTypes: {
> 23 | radiumConfig: _react.PropTypes.object,
| ^ 24 | rules: _react.PropTypes.object,
25 | scopeSelector: _react.PropTypes.string
26 | },
谷歌搜索后,我登陆了 jscodeshift ......所以我跑了
% jscodeshift --extensions js -t react-codemod/transforms/React-PropTypes-to-prop-types.js node_modules/radium/lib/components/ --explicit-require=false
Processing 3 files...
Spawning 3 workers...
Sending 1 files to free worker...
Sending 1 files to free worker...
Sending 1 files to free worker...
All done.
Results:
0 errors
0 unmodified
3 skipped
0 ok
Time elapsed: 0.770seconds
我用谷歌搜索了一些,其他人在导入时遇到了问题,例如材料 UI,代码中没有返回,或者除了 js 文件。我什至删除了节点模块并重新安装了 npm 无济于事。我似乎无法为我的问题找到任何解决方案。
这是我的 package.JSON 依赖项...
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/react-burger-menu": "^2.6.1",
"jscodeshift": "^0.9.0",
"prop-types": "^15.7.2",
"radium": "^0.26.0",
"react": "^15.6.2",
"react-burger-menu": "^1.12.0",
"react-dom": "^15.6.2",
"react-scripts": "3.4.1",
"yarn": "^1.22.4"
},
任何帮助深表感谢。ps:我愿意完全重置整个项目。