Skip to content

Commit 5bef286

Browse files
thiskevinwangtimdorr
authored andcommitted
fix broken link in hooks.md (#1465)
* fix broken link in hooks.md * use relative path & redirected target * update link in website/versioned - remove extra whitespace * Update hooks.md * Update hooks.md
1 parent 24354a6 commit 5bef286

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/api/hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Allows you to extract data from the Redux store state, using a selector function
4040

4141
> **Note**: The selector function should be [pure](https://en.wikipedia.org/wiki/Pure_function) since it is potentially executed multiple times and at arbitrary points in time.
4242
43-
The selector is approximately equivalent to the [`mapStateToProps` argument to `connect`](using-react-redux/connect-extracting-data-with-mapStateToProps.md) conceptually. The selector will be called with the entire Redux store state as its only argument. The selector will be run whenever the function component renders. `useSelector()` will also subscribe to the Redux store, and run your selector whenever an action is dispatched.
43+
The selector is approximately equivalent to the [`mapStateToProps` argument to `connect`](../using-react-redux/connect-extracting-data-with-mapStateToProps.md) conceptually. The selector will be called with the entire Redux store state as its only argument. The selector will be run whenever the function component renders. `useSelector()` will also subscribe to the Redux store, and run your selector whenever an action is dispatched.
4444

4545
However, there are some differences between the selectors passed to `useSelector()` and a `mapState` function:
4646

website/versioned_docs/version-7.1/api/hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Allows you to extract data from the Redux store state, using a selector function
4141

4242
> **Note**: The selector function should be [pure](https://en.wikipedia.org/wiki/Pure_function) since it is potentially executed multiple times and at arbitrary points in time.
4343
44-
The selector is approximately equivalent to the [`mapStateToProps` argument to `connect`](using-react-redux/connect-extracting-data-with-mapStateToProps.md) conceptually. The selector will be called with the entire Redux store state as its only argument. The selector will be run whenever the function component renders. `useSelector()` will also subscribe to the Redux store, and run your selector whenever an action is dispatched.
44+
The selector is approximately equivalent to the [`mapStateToProps` argument to `connect`](../using-react-redux/connect-extracting-data-with-mapStateToProps.md) conceptually. The selector will be called with the entire Redux store state as its only argument. The selector will be run whenever the function component renders. `useSelector()` will also subscribe to the Redux store, and run your selector whenever an action is dispatched.
4545

4646
However, there are some differences between the selectors passed to `useSelector()` and a `mapState` function:
4747

@@ -355,7 +355,7 @@ This hook was in our original alpha release, but removed in `v7.1.0-alpha.4`, ba
355355
That suggestion was based on "binding action creators" not being as useful in a hooks-based use case, and causing too
356356
much conceptual overhead and syntactic complexity.
357357

358-
You should probably prefer to call the [`useDispatch`](#usedispatch) hook in your components to retrieve a reference to `dispatch`,
358+
You should probably prefer to call the [`useDispatch`](#usedispatch) hook in your components to retrieve a reference to `dispatch`,
359359
and manually call `dispatch(someActionCreator())` in callbacks and effects as needed. You may also use the Redux
360360
[`bindActionCreators`](https://redux.js.org/api/bindactioncreators) function in your own code to bind action creators,
361361
or "manually" bind them like `const boundAddTodo = (text) => dispatch(addTodo(text))`.

0 commit comments

Comments
 (0)