nkbt / react-height

Component-wrapper to determine and report children elements height
MIT License
180 stars 27 forks source link

Cannot read property 'isRequired' of undefined #24

Closed JohnAllen closed 7 years ago

JohnAllen commented 7 years ago

I get this in the console even when I paste in the example in the README. What could I be doing wrong? Have tried all sorts of children here.

nkbt commented 7 years ago

Must be one of proptypes is incorrect. Like boolean instead of bool or function instead of func or smth similar.

Any more info?

JohnAllen commented 7 years ago

Yeah, it's this line:

var ReactHeight = _react2.default.createClass({                                                                        // 24
  displayName: 'ReactHeight',                                                                                          // 25
                                                                                                                       // 26
  propTypes: {                                                                                                         // 27
    children: _react2.default.PropTypes.node.isRequired,   
nkbt commented 7 years ago

'node' is undefined? That's not really possible https://facebook.github.io/react/docs/typechecking-with-proptypes.html