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

A Proposal: add some defaults for prop-types to ignore #54

Closed
AlexKVal opened this issue Apr 7, 2015 · 4 comments
Closed

A Proposal: add some defaults for prop-types to ignore #54

AlexKVal opened this issue Apr 7, 2015 · 4 comments

Comments

@AlexKVal
Copy link
Contributor

AlexKVal commented Apr 7, 2015

As in React.Children said:

React.Children provides utilities for dealing with the this.props.children opaque data structure.

props.children has an opaque type.

So maybe it would be wise to add it into some kind of defaults list to ignore.

For now it needs to be added

"react/prop-types": [1, { ignore: [children] }]

into .eslintrc.

Same is true for className (and maybe for some more, that I'm not aware of yet).

I am new to React development and I believe I just don't know something related to written above,
so I'm looking for help with this idea.

If it turns up the idea is right one, I could try to implement it (with tests and docs of course).

@yannickcr
Copy link
Member

In first implementation children was always ignored since defining some propTypes for it is not a very common practice. But as @AsaAyers pointed out, there is no particular reason to document all props but not children. Same for className.

I think you can discuss it in #7.

@AsaAyers
Copy link

AsaAyers commented Apr 7, 2015

IMO if children is difficult to figure out which type to use, you can always use React.PropTypes.any.

@AlexKVal
Copy link
Contributor Author

AlexKVal commented Apr 7, 2015

I knew I wasn't first who noticed. 😄
So I think it would be logical to add notice about this situation into docs for future developers.
My possible solution for this is #55.
English is not my native, so I'm apologise for any errors.

@yannickcr
Copy link
Member

Thanks! Documentation improvement is always welcome :)

@AlexKVal AlexKVal changed the title Proposition: add some defaults for prop-types to ignore A Proposal: add some defaults for prop-types to ignore Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants