Skip to content

Commit 715c228

Browse files
committed
docs: refine this context wording for setState callback
1 parent abe931a commit 715c228

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/content/reference/react/Component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ You don't have to do this, but it's handy if you want to update state multiple t
655655
* If you pass an object as `nextState`, it will be shallowly merged into `this.state`.
656656
* If you pass a function as `nextState`, it will be treated as an _updater function_. It must be pure, should take the pending state and props as arguments, and should return the object to be shallowly merged into `this.state`. React will put your updater function in a queue and re-render your component. During the next render, React will calculate the next state by applying all of the queued updaters to the previous state.
657657
658-
* **optional** `callback`: If specified, React will call the `callback` you've provided after the update is committed.
658+
* **optional** `callback`: If specified, React will call the `callback` you've provided after the update is committed. React automatically binds the `this` keyword inside the callback to the current component.
659659
660660
#### Returns {/*setstate-returns*/}
661661

0 commit comments

Comments
 (0)