Skip to content

Commit

Permalink
[Docs] setProps accepts a callback as second argument
Browse files Browse the repository at this point in the history
  • Loading branch information
wanecek authored and ljharb committed Aug 26, 2018
1 parent 2f49989 commit 316c7c3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/api/ReactWrapper/setContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ that includes a `context` specified in the options argument.

#### Related Methods

- [`.setState(state) => Self`](setState.md)
- [`.setProps(props) => Self`](setProps.md)
- [`.setState(state[, callback]) => Self`](setState.md)
- [`.setProps(props[, callback]) => Self`](setProps.md)


2 changes: 1 addition & 1 deletion docs/api/ReactWrapper/setState.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ expect(wrapper.find('.bar')).to.have.lengthOf(1);

#### Related Methods

- [`.setProps(props) => Self`](setProps.md)
- [`.setProps(props[, callback]) => Self`](setProps.md)
- [`.setContext(context) => Self`](setContext.md)


4 changes: 2 additions & 2 deletions docs/api/ShallowWrapper/setContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ that includes a `context` specified in the options argument.

#### Related Methods

- [`.setState(state) => Self`](setState.md)
- [`.setProps(props) => Self`](setProps.md)
- [`.setState(state[, callback]) => Self`](setState.md)
- [`.setProps(props[, callback]) => Self`](setProps.md)


3 changes: 2 additions & 1 deletion docs/api/ShallowWrapper/setProps.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `.setProps(nextProps) => Self`
# `.setProps(nextProps[, callback]) => Self`

A method that sets the props of the root component, and re-renders. Useful for when you are
wanting to test how the component behaves over time with changing props. Calling this, for
Expand All @@ -13,6 +13,7 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
#### Arguments

1. `nextProps` (`Object`): An object containing new props to merge in with the current props
2. `callback` (`Function` [optional]): If provided, the callback function will be executed once setProps has completed



Expand Down
2 changes: 1 addition & 1 deletion docs/api/ShallowWrapper/setState.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ expect(wrapper.find('.bar')).to.have.lengthOf(1);

#### Related Methods

- [`.setProps(props) => Self`](setProps.md)
- [`.setProps(props[, callback]) => Self`](setProps.md)
- [`.setContext(context) => Self`](setContext.md)


0 comments on commit 316c7c3

Please sign in to comment.