Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 16 compatibility issues #17

Open
vivekiyer114 opened this issue Jan 21, 2018 · 1 comment
Open

React 16 compatibility issues #17

vivekiyer114 opened this issue Jan 21, 2018 · 1 comment

Comments

@vivekiyer114
Copy link

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,
@mohsenmahoski
Copy link

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 :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants