joeybaker / react-element-query

Element queries for react components.
Other
86 stars 7 forks source link

Proptypes in dist/index.js #47

Closed sag1v closed 6 years ago

sag1v commented 6 years ago

Hello, I've noticed there is an deprecated build file in the dist/index.js on npm. I'm using react-element-query in a library i'm working on and i get an error:

Uncaught TypeError: Cannot read property 'node' of undefined

That points to `dist/index.js`:
(_react.Component), _class3.propTypes = {
  children: _react.PropTypes.node.isRequired,
  default: _react.PropTypes.string,
  sizes: _react.PropTypes.arrayOf(_react.PropTypes.shape({
    name: _react.PropTypes.string.isRequired,
// ...

After watching the file itself in my node_modules, indeed the code looks like its using the old proptypes from react library. I cloned your project and did a build and it looks fine and using the new prop-type library:

(_react.PureComponent), _class2.propTypes = {
  children: _proptypes2.default.node.isRequired,
  default: _proptypes2.default.string,
  sizes: _proptypes2.default.arrayOf(_proptypes2.default.shape({
    name: _proptypes2.default.string.isRequired,
    width: function width(props, propName, componentName) {
// ...

So i think the npm package isn't up-to-date with the current version of build.

joeybaker commented 6 years ago

You're right! Sorry about that.

v3.0.3 published.