Skip to content

Commit fa597b5

Browse files
committed
update connect docs
1 parent 458415b commit fa597b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/api/connect.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ connect(mapStateToProps, mapDispatchToProps, null, { context: MyContext })(
233233
)
234234
```
235235
236-
#### `areStatesEqual: (next: Object, prev: Object) => boolean`
236+
#### `areStatesEqual: (next: Object, prev: Object, nextOwnProps: Object, prevOwnProps: Object) => boolean`
237237
238238
- default value: `strictEqual: (next, prev) => prev === next`
239239
@@ -244,7 +244,7 @@ const areStatesEqual = (next, prev) =>
244244
prev.entities.todos === next.entities.todos
245245
```
246246
247-
You may wish to override `areStatesEqual` if your `mapStateToProps` function is computationally expensive and is also only concerned with a small slice of your state. The example above will effectively ignore state changes for everything but that slice of state.
247+
You may wish to override `areStatesEqual` if your `mapStateToProps` function is computationally expensive and is also only concerned with a small slice of your state. The example above will effectively ignore state changes for everything but that slice of state. Additionally, `areStatesEqual` provides `nextOwnProps` and `prevOwnProps` to allow for more effective scoping of your state which your connected component is interested in, if needed.
248248
249249
This would likely impact the other equality checks as well, depending on your `mapStateToProps` function.
250250

0 commit comments

Comments
 (0)