diff --git a/src/components/connect.tsx b/src/components/connect.tsx index d97da5c..e5c1949 100644 --- a/src/components/connect.tsx +++ b/src/components/connect.tsx @@ -312,7 +312,7 @@ export interface Connect { ( mapStateToProps: null | undefined, mapDispatchToProps: null | undefined, - mergeProps: MergeProps + mergeProps: MergeProps ): InferableComponentEnhancerWithProps /** mapState and mergeProps */ @@ -325,7 +325,7 @@ export interface Connect { >( mapStateToProps: MapStateToPropsParam, mapDispatchToProps: null | undefined, - mergeProps: MergeProps + mergeProps: MergeProps ): InferableComponentEnhancerWithProps /** mapDispatch (as a object) and mergeProps */ diff --git a/test/typetests/connect-options-and-issues.tsx b/test/typetests/connect-options-and-issues.tsx index 24e3f4b..1f05c77 100644 --- a/test/typetests/connect-options-and-issues.tsx +++ b/test/typetests/connect-options-and-issues.tsx @@ -103,6 +103,14 @@ function TestMergedPropsInference() { merged: 'merged', }) )(MergedPropsComponent) + + const ConnectedWithInferredDispatch = connect( + mapStateToProps, + undefined, + (stateProps, dispatchProps, ownProps) => { + expectType>(dispatchProps) + } + )(MergedPropsComponent) } function Issue16652() {