react-flipcard icon indicating copy to clipboard operation
react-flipcard copied to clipboard

React 16 compatibility issues

Open vivekiyer114 opened this issue 7 years ago • 1 comments

When i import FlipCard component, it gives the following warning:-

TypeError: Cannot read property 'string' of undefined


  64010 | displayName: 'ReactFlipCard',
  64011 | 
  64012 | propTypes: {
> 64013 |   type: _react.PropTypes.string,
        |                          ^  64014 |   flipped: _react.PropTypes.bool,
  64015 |   disabled: _react.PropTypes.bool,
  64016 |   onFlip: _react.PropTypes.func,

vivekiyer114 avatar Jan 21 '18 10:01 vivekiyer114

first install prop-types : npm i prop-types --save

and in FlipCard.js : add var PropTypes = require('prop-types'); and replace _react.PropTypes with PropTypes after that i have a new problem:

TypeError : _react2.default.createClass is not a function

to resolve this problem too i did same : npm install create-react-class --save add var createReactClass = require('create-react-class'); and replace _react2['default'].createClass with createReactClass

save FlipCard.js and restart project with npm start and it worked like a charm!!! Hope this has been helpful :))

mohsenmahoski avatar Mar 07 '19 10:03 mohsenmahoski