Skip to content

Commit c5a79ab

Browse files
authored
Merge pull request reduxjs#426 from nico-schneider/patch-1
Clarify mapStateToProps re-evaluation when ownProps are used
2 parents 313f632 + 73ed6a5 commit c5a79ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Instead, it *returns* a new, connected component class, for you to use.
4949

5050
#### Arguments
5151

52-
* [`mapStateToProps(state, [ownProps]): stateProps`] \(*Function*): If specified, the component will subscribe to Redux store updates. Any time it updates, `mapStateToProps` will be called. Its result must be a plain object*, and it will be merged into the component’s props. If you omit it, the component will not be subscribed to the Redux store. If `ownProps` is specified as a second argument, its value will be the props passed to your component, and `mapStateToProps` will be re-invoked whenever the component receives new props.
52+
* [`mapStateToProps(state, [ownProps]): stateProps`] \(*Function*): If specified, the component will subscribe to Redux store updates. Any time it updates, `mapStateToProps` will be called. Its result must be a plain object*, and it will be merged into the component’s props. If you omit it, the component will not be subscribed to the Redux store. If `ownProps` is specified as a second argument, its value will be the props passed to your component, and `mapStateToProps` will be additionally re-invoked whenever the component receives new props (e.g. if props received from a parent component have shallowly changed, and you use the ownProps argument, mapStateToProps is re-evaluated).
5353

5454
>Note: in advanced scenarios where you need more control over the rendering performance, `mapStateToProps()` can also return a function. In this case, *that* function will be used as `mapStateToProps()` for a particular component instance. This allows you to do per-instance memoization. You can refer to [#279](https://github.com/reactjs/react-redux/pull/279) and the tests it adds for more details. Most apps never need this.
5555

0 commit comments

Comments
 (0)