-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Add section about not spreading props #1629
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
Conversation
|
cc @ljharb |
ljharb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great!
Let's also suggest using https://npmjs.com/prop-types-exact on Component propTypes whenever possible as well, to help prevent bugs sooner :-)
react/README.md
Outdated
| ``` | ||
|
|
||
| - Use spread props sparingly. | ||
| > Why? Otherwise you're more likely to pass unnecessary props down to components. And for React 15 and older, you could [pass invalid HTML attributes to the DOM](https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's React < 15.2 or 15.3? Let's be specific here :-)
e7b04b3 to
99076f5
Compare
|
Thanks @ljharb ! This is ready for re-review. :) I'm not sure why the Travis build is failing--looking into it. |
|
Tests will now pass once this is rebased on master. |
99076f5 to
5682155
Compare
|
@ljharb Whenever you get a chance, I made your suggested changes. What do you think -- does it need more edits? |
Fixes #1443