diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index fc3c54bef1..c0a3692f2a 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -5,6 +5,7 @@ // Thomas Hasner , // Kenzie Togami , // Curits Layne +// Frank Tan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -134,17 +135,17 @@ export declare function connect; interface MapStateToProps { - (state: any, ownProps?: TOwnProps): TStateProps; + (state: any, ownProps: TOwnProps): TStateProps; } interface MapStateToPropsFactory { - (initialState: any, ownProps?: TOwnProps): MapStateToProps; + (initialState: any, ownProps: TOwnProps): MapStateToProps; } type MapStateToPropsParam = MapStateToProps | MapStateToPropsFactory; interface MapDispatchToPropsFunction { - (dispatch: Dispatch, ownProps?: TOwnProps): TDispatchProps; + (dispatch: Dispatch, ownProps: TOwnProps): TDispatchProps; } interface MapDispatchToPropsObject { @@ -155,7 +156,7 @@ type MapDispatchToProps = MapDispatchToPropsFunction | MapDispatchToPropsObject; interface MapDispatchToPropsFactory { - (dispatch: Dispatch, ownProps?: TOwnProps): MapDispatchToProps; + (dispatch: Dispatch, ownProps: TOwnProps): MapDispatchToProps; } type MapDispatchToPropsParam = MapDispatchToProps | MapDispatchToPropsFactory; diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 1bf9dae4f2..0ebcc3a820 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -63,8 +63,8 @@ connect( )(Counter); // with higher order functions using parameters connect( - (initialState: CounterState, ownProps: {}) => mapStateToProps, - (dispatch: Dispatch, ownProps: {}) => mapDispatchToProps + (initialState: CounterState, ownProps) => mapStateToProps, + (dispatch: Dispatch, ownProps) => mapDispatchToProps )(Counter); // only first argument connect(