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
Updating Thinking in React doc to replace refs with event handlers #8815
Updating Thinking in React doc to replace refs with event handlers #8815
Conversation
One problem with this is sending props “up” can potentially swallow some updates. This is not the case in this particular example but I’d like to avoid this pattern if possible. In React, Can you also try creating another version with two separate callbacks so that we could compare them? |
Will do shortly. |
@gaearon the second version is here: http://codepen.io/rohan10/pen/xgRLqJ IMHO, while it's a lot more verbose, I think it does get the concept across in a more digestible manner. |
Yea, I like it better. Let's use it? |
@gaearon the CodePen has been updated, and I also adjusted the copy slightly to reflect that there are multiple callbacks passed in. |
this.props.onInStockInput(
e.target.value
); You probably want Also maybe it's not worth using newlines here: this.props.onInStockInput(e.target.checked); |
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.
Need to fix the checkbox.
Fixed. |
Thank you! |
Oops: #8996 |
Fixes #8209 (comment)