-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Update Lifting State Up not to mix up DOM value with component state #9032
Conversation
A few weeks ago when teaching my friend, she got stuck on `this.state.value` vs. `event.target.value`. As the documentation talked a lot about "values", and the term value could mean three different things (values in general, the "value" prop / DOM value of the <input> component and the value in state/props), it was not weird that she got a bit confused.
Can we also rename onChange then? |
Yeah, we could. Maybe we could rename it to |
This is in-line with how the temperature is provided as a prop named `temperature`
There, that should do it |
Anything I could do to get this shipped? Do I need to update the code pens to contain the new code, too? |
Let me know if it was OK to change the codepen examples to also contain the updated code. Feel free to fork the pens for your account if you don't want them to show up under my name |
Can you also make a new GIF at the end? 😅 |
Oh yeah, sure, I can do that 😄. Funny how I didn't see how many things would need to be changed but I'm totally fine with this 😄 |
That should do it |
We are no longer using our custom labels. 😉 |
OK, that’s pretty great. Thanks for doing this. |
🎉 Thanks for merging! |
Hiya, how and when do you update the documentations normally? It's been a week since this PR was merged. Do you only update the website with new major versions or some other milestone? |
Not really, just when somebody runs a script that updates the docs. |
…9032) * Update Lifting State Up not to mix up DOM value with component state A few weeks ago when teaching my friend, she got stuck on `this.state.value` vs. `event.target.value`. As the documentation talked a lot about "values", and the term value could mean three different things (values in general, the "value" prop / DOM value of the <input> component and the value in state/props), it was not weird that she got a bit confused. * Rename Lifting State Up onChange props to onTemperatureChange This is in-line with how the temperature is provided as a prop named `temperature` * Fix one value prop not being renamed to temperature * Update codepen examples in Lifting state up documentation * Update devtools state change to reflect docs change (cherry picked from commit a190cfc)
Ran the script. Docs should update soon. |
Updated. |
Thank you, I noticed yesterday already |
A few weeks ago when teaching my friend, she got stuck on
this.state.value
vs.event.target.value
. As the documentation talked a lot about "values", and the term "value" could mean three different things (values in general, thevalue
prop / DOM value of the<input>
component and thevalue
in state/props), it was not weird that she got a bit confused.I asked about this already from @gaearon in Twitter here: https://twitter.com/valscion/status/833776451442843649