-
Notifications
You must be signed in to change notification settings - Fork 45.5k
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
Add a link to "State Updates are Merged" in the forms doc #8851
Conversation
@@ -231,6 +231,8 @@ class Reservation extends React.Component { | |||
} | |||
``` | |||
|
|||
Since `setState()` automatically merges a partial state into the current state ([State Updates are Merged](/react/docs/state-and-lifecycle.html#state-updates-are-merged)), we only needed to call it with the changed parts. |
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.
Let's just make "merges a partial [...]" itself a link.
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.
👍 Updated.
@@ -231,7 +231,7 @@ class Reservation extends React.Component { | |||
} | |||
``` | |||
|
|||
Since `setState()` automatically merges a partial state into the current state ([State Updates are Merged](/react/docs/state-and-lifecycle.html#state-updates-are-merged)), we only needed to call it with the changed parts. | |||
Since `setState()` automatically [merges a partial state into the current state](/react/docs/state-and-lifecycle.html#state-updates-are-merged), we only needed to call it with the changed parts. |
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.
For consistency let's put this paragraph after the link. In fact maybe after the property explanation.
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.
👍. If we also rename nextState
to partialState
in the property explanation will it be more clear?
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.
Sounds good.
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.
Or pendingState
, which is more accurate here.
Added a few tweaks of my own (use |
* Added a link to "State Updates are Merged" * better inline links * moved the explanation down * Minor unrelated tweaks (cherry picked from commit eb89bc4)
Thank you! |
It was brought up on https://twitter.com/patrickkerrypei/status/823608012841648130