Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e88c0b1

Browse files
sophiebitszpao
authored andcommitted
Add callback to setProps docs
(cherry picked from commit 2d66fc4)
1 parent 950ecd8 commit e88c0b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/docs/ref-02-component-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ If this component has been mounted into the DOM, this returns the corresponding
2424
### setProps
2525

2626
```javascript
27-
setProps(object nextProps)
27+
setProps(object nextProps[, function callback])
2828
```
2929

30-
When you're integrating with an external JavaScript application you may want to signal a change to a React component rendered with `renderComponent()`. Simply call `setProps()` to change its properties and trigger a re-render.
30+
When you're integrating with an external JavaScript application you may want to signal a change to a React component rendered with `renderComponent()`. Simply call `setProps()` to change its properties and trigger a re-render. In addition, you can supply an optional callback function that is executed once `setProps` is completed.
3131

3232
> Note:
3333
>
@@ -37,7 +37,7 @@ When you're integrating with an external JavaScript application you may want to
3737
### replaceProps
3838

3939
```javascript
40-
replaceProps(object nextProps)
40+
replaceProps(object nextProps[, function callback])
4141
```
4242

4343
Like `setProps()` but deletes any pre-existing props instead of merging the two objects.

0 commit comments

Comments
 (0)