react-flipcard
react-flipcard copied to clipboard
React 16 compatibility issues
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,
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 :))