You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/connect.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -571,7 +571,7 @@ export default connect(
571
571
572
572
The number of declared function parameters of `mapStateToProps` and `mapDispatchToProps` determines whether they receive `ownProps`
573
573
574
-
> Note: `ownProps` is not passed to `mapStateToProps` and `mapDispatchToProps` if the formal definition of the function contains one mandatory parameter (function has length 1). For example, functions defined like below won't receive `ownProps` as the second argument. If the incoming value of `ownProps` is `undefined`, the default argument value will be used.
574
+
> Note: `ownProps` is not passed to `mapStateToProps` and `mapDispatchToProps` if the formal definition of the function contains one mandatory parameter (function has length 1). For example, functions defined like below won't receive `ownProps` as the second argument. If the incoming value of `ownProps` is `undefined`, the default argument value will be used.
Copy file name to clipboardExpand all lines: docs/api/hooks.md
+10-13Lines changed: 10 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,6 @@ React Redux now offers a set of hook APIs as an alternative to the existing `con
13
13
14
14
These hooks were first added in v7.1.0.
15
15
16
-
17
16
## Using Hooks in a React Redux App
18
17
19
18
As with `connect()`, you should start by wrapping your entire application in a `<Provider>` component to make the store available throughout the component tree:
The `<Provider>` component allows you to specify an alternate context via the `context` prop. This is useful if you're building a complex reusable component, and you don't want your store to collide with any Redux store your consumers' applications might use.
@@ -395,7 +389,7 @@ This hook was in our original alpha release, but removed in `v7.1.0-alpha.4`, ba
395
389
That suggestion was based on "binding action creators" not being as useful in a hooks-based use case, and causing too
396
390
much conceptual overhead and syntactic complexity.
397
391
398
-
You should probably prefer to call the [`useDispatch`](#usedispatch) hook in your components to retrieve a reference to `dispatch`,
392
+
You should probably prefer to call the [`useDispatch`](#usedispatch) hook in your components to retrieve a reference to `dispatch`,
399
393
and manually call `dispatch(someActionCreator())` in callbacks and effects as needed. You may also use the Redux
400
394
[`bindActionCreators`](https://redux.js.org/api/bindactioncreators) function in your own code to bind action creators,
401
395
or "manually" bind them like `const boundAddTodo = (text) => dispatch(addTodo(text))`.
@@ -410,12 +404,15 @@ import { useMemo } from 'react'
0 commit comments