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

7.2.0 breaks Object.freeze #1366

Closed
nihgwu opened this issue Aug 14, 2017 · 4 comments
Closed

7.2.0 breaks Object.freeze #1366

nihgwu opened this issue Aug 14, 2017 · 4 comments

Comments

@nihgwu
Copy link

nihgwu commented Aug 14, 2017

the following code works on v7.1.0

  static propTypes = Object.freeze({
    value: PropTypes.any.isRequired,
  });
@ljharb
Copy link
Member

ljharb commented Aug 14, 2017

Can you elaborate on "works"?

Do you have Object.freeze defined as a wrapper function in settings?

@nihgwu
Copy link
Author

nihgwu commented Aug 14, 2017

@ljharb "works" means I get no eslint errors
I've tried your suggestion, but still no fortune. still get the errors error 'value' is missing in props validation react/prop-types

  "settings": {
    "react": {
      "version": "15.6.1"
    },
    "propWrapperFunctions": [ "Object.freeze" ]
  },

@ljharb
Copy link
Member

ljharb commented Aug 14, 2017

That seems like it's a bug in the prop-types rule then (without propWrapperFunctions, you should definitely get a warning there).

@yannickcr
Copy link
Member

@nihgwu If I'm right this pattern was not detected in v7.1.0 and the propTypes validation was just ignored for the component. This is no longer the case since v7.2.0.

But #1366 (comment) should have worked, so there was definitively a bug here.

It should be fixed in next release.

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

No branches or pull requests

3 participants