Skip to content

Commit f6c4830

Browse files
authored
change mapStateToProp to mapStateToProps (#1586)
1 parent 0db8f32 commit f6c4830

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

website/versioned_docs/version-7.1/using-react-redux/static-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ However, inferring the type of `mapDispatch` this way will break if it is define
151151
152152
`connect` consists of two functions that are called sequentially. The first function accepts `mapState` and `mapDispatch` as arguments, and returns a second function. The second function accepts the component to be wrapped, and returns a new wrapper component that passes down the props from `mapState` and `mapDispatch`. Normally, both functions are called together, like `connect(mapState, mapDispatch)(MyComponent)`.
153153
154-
As of v7.1.2, the `@types/react-redux` package exposes a helper type, `ConnectedProps`, that can extract the return types of `mapStateToProp` and `mapDispatchToProps` from the first function. This means that if you split the `connect` call into two steps, all of the "props from Redux" can be inferred automatically without having to write them by hand. While this approach may feel unusual if you've been using React-Redux for a while, it does simplify the type declarations considerably.
154+
As of v7.1.2, the `@types/react-redux` package exposes a helper type, `ConnectedProps`, that can extract the return types of `mapStateToProps` and `mapDispatchToProps` from the first function. This means that if you split the `connect` call into two steps, all of the "props from Redux" can be inferred automatically without having to write them by hand. While this approach may feel unusual if you've been using React-Redux for a while, it does simplify the type declarations considerably.
155155
156156
```ts
157157
import { connect, ConnectedProps } from 'react-redux'

0 commit comments

Comments
 (0)