Skip to content
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

Fixes #509: pass callback on setState and setProps #617

Merged
merged 7 commits into from
Oct 11, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update docs
  • Loading branch information
alecrobins authored and Alec Robins committed Oct 11, 2016
commit ef799ce2791427043f994ddee2afa7f5152749a9
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* [render()](/docs/api/ShallowWrapper/render.md)
* [setContext(context)](/docs/api/ShallowWrapper/setContext.md)
* [setProps(nextProps)](/docs/api/ShallowWrapper/setProps.md)
* [setState(nextState)](/docs/api/ShallowWrapper/setState.md)
* [setState(nextState[, cb])](/docs/api/ShallowWrapper/setState.md)
Copy link
Contributor

@lencioni lencioni Oct 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to use callback for this variable (here and elsewhere), for maximum clarity.

* [shallow([options])](/docs/api/ShallowWrapper/shallow.md)
* [simulate(event[, data])](/docs/api/ShallowWrapper/simulate.md)
* [some(selector)](/docs/api/ShallowWrapper/some.md)
Expand Down Expand Up @@ -110,8 +110,8 @@
* [ref(refName)](/docs/api/ReactWrapper/ref.md)
* [render()](/docs/api/ReactWrapper/render.md)
* [setContext(context)](/docs/api/ReactWrapper/setContext.md)
* [setProps(nextProps)](/docs/api/ReactWrapper/setProps.md)
* [setState(nextState)](/docs/api/ReactWrapper/setState.md)
* [setProps(nextProps[, cb])](/docs/api/ReactWrapper/setProps.md)
* [setState(nextState[, cb])](/docs/api/ReactWrapper/setState.md)
* [simulate(event[, data])](/docs/api/ReactWrapper/simulate.md)
* [some(selector)](/docs/api/ReactWrapper/some.md)
* [someWhere(predicate)](/docs/api/ReactWrapper/someWhere.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ReactWrapper/setProps.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `.setProps(props) => Self`
# `.setProps(props[, cb]) => 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,7 +13,7 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
#### Arguments

1. `props` (`Object`): An object containing new props to merge in with the current state

2. `cb` (`Function` [optional]): If provided, the callback function will be executed once setProps has completed


#### Returns
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ReactWrapper/setState.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `.setState(state) => Self`
# `.setState(state[, cb]) => Self`

A method to invoke `setState()` on the root component instance similar to how you might in the
definition of the component, and re-renders. This method is useful for testing your component
Expand All @@ -12,7 +12,7 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
#### Arguments

1. `state` (`Object`): An object containing new state to merge in with the current state

2. `cb` (`Function` [optional]): If provided, the callback function will be executed once setState has completed


#### Returns
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ShallowWrapper/setState.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `.setState(state) => Self`
# `.setState(state[, cb]) => Self`

A method to invoke `setState()` on the root component instance similar to how you might in the
definition of the component, and re-renders. This method is useful for testing your component
Expand All @@ -12,7 +12,7 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
#### Arguments

1. `state` (`Object`): An object containing new state to merge in with the current state

2. `cb` (`Function` [optional]): If provided, the callback function will be executed once setState has completed


#### Returns
Expand Down