cannot read property 'shape' of undefined

cannot read property 'shape' of undefined_第1张图片

被困住了一段时间,很感谢这位外国友人
原文链接

解决方法:

 npm/yarn install prop-types create-react-class --save

然后进入node_modules/react/index.js文件,在代码后加上如下代码

module.exports.PropTypes = require('prop-types');
let createClass;
Object.defineProperty(module.exports, 'createClass', {
  get: function() {
    if (!createClass) {
      createClass = require('create-react-class').bind(module.exports);
    }
    return createClass;
  }
});

你可能感兴趣的:(iOS开发)