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

Shape validation does not recognize deconstructed props attributes #7815

Closed
nwikstrand opened this issue Sep 27, 2016 · 3 comments
Closed

Shape validation does not recognize deconstructed props attributes #7815

nwikstrand opened this issue Sep 27, 2016 · 3 comments

Comments

@nwikstrand
Copy link

Bug (?)

Shape validation does not recognize deconstructed props attribute.
'bar.baz' PropType is defined but prop is never used react/no-unused-prop-types

Failing example with deconstructed props:

const Foo = ({bar}) => (
  <div>
    {bar.baz}
  </div>
);

Foo.propTypes = {
  bar: React.PropTypes.shape({
    baz: React.PropTypes.string,
  }),
};

Working example with non deconstructed props:

const Foo = (props) => (
  <div>
    {props.bar.baz}
  </div>
);

Foo.propTypes = {
  bar: React.PropTypes.shape({
    baz: React.PropTypes.string,
  }),
};
@syranide
Copy link
Contributor

That's an issue with the hinting-software you're using, specifically a react plugin for it. Not React.

@aweary
Copy link
Contributor

aweary commented Sep 27, 2016

Looks like you're using eslint-plugin-react. You're best bet is to direct your question there https://github.com/yannickcr/eslint-plugin-react

@aweary aweary closed this as completed Sep 27, 2016
@nwikstrand
Copy link
Author

My bad, thanks for pointing that out :)

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

3 participants