Skip to content

Commit 808d1e7

Browse files
committed
Address PR comment and fix additional missing link
1 parent 14311b0 commit 808d1e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/using-react-redux/connect-extracting-data-with-mapStateToProps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function mapStateToProps(state) {
9292
// component will receive: props.a, props.todos, and props.filter
9393
```
9494
95-
> 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 the final `mapStateToProps` for a particular component instance. This allows you to do per-instance memoization. See the [Advanced Usage: Factory Functions](https://react-redux.js.org/api/connect#factory-functions) section of the docs for more details, as well as [PR #279](https://github.com/reduxjs/react-redux/pull/279) and the tests it adds. Most apps never need this.
95+
> 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 the final `mapStateToProps` for a particular component instance. This allows you to do per-instance memoization. See the [Advanced Usage: Factory Functions](../api/connect.md) section of the docs for more details, as well as [PR #279](https://github.com/reduxjs/react-redux/pull/279) and the tests it adds. Most apps never need this.
9696
9797
## Usage Guidelines
9898
@@ -139,7 +139,7 @@ Many common operations result in new object or array references being created:
139139
- Copying values with `Object.assign`
140140
- Copying values with the spread operator `{ ...oldState, ...newData }`
141141
142-
Put these operations in [memoized selector functions]() to ensure that they only run if the input values have changed. This will also ensure that if the input values _haven't_ changed, `mapStateToProps` will still return the same result values as before, and `connect` can skip re-rendering.
142+
Put these operations in [memoized selector functions](https://redux.js.org/recipes/computing-derived-data#creating-a-memoized-selector) to ensure that they only run if the input values have changed. This will also ensure that if the input values _haven't_ changed, `mapStateToProps` will still return the same result values as before, and `connect` can skip re-rendering.
143143
144144
### Only Perform Expensive Operations When Data Changes
145145

0 commit comments

Comments
 (0)