Skip to content

Commit 1186016

Browse files
anthonyc1markerikson
authored andcommitted
docs: Fix missing links in mapStateToProps.md (#1467)
* docs: Fix missing links in mapStateToProps.md * Address PR comment and fix additional missing link
1 parent a51296f commit 1186016

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
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]() 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
@@ -102,7 +102,7 @@ function mapStateToProps(state) {
102102
103103
### Use Selector Functions to Extract and Transform Data
104104
105-
We highly encourage the use of "selector" functions to help encapsulate the process of extracting values from specific locations in the state tree. Memoized selector functions also play a key role in improving application performance (see the following sections in this page and the [Advanced Usage: Performance]() page for more details on why and how to use selectors.)
105+
We highly encourage the use of "selector" functions to help encapsulate the process of extracting values from specific locations in the state tree. Memoized selector functions also play a key role in improving application performance (see the following sections in this page and the [Advanced Usage: Computing Derived Data](https://redux.js.org/recipes/computing-derived-data) page for more details on why and how to use selectors.)
106106
107107
### `mapStateToProps` Functions Should Be Fast
108108
@@ -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)