Merge pull request #14623 from plee-nm/master

14622 Allow for mapStateToProps to be undefined.
This commit is contained in:
Mine Starks
2017-03-06 15:24:05 -08:00
committed by GitHub
2 changed files with 6 additions and 10 deletions

View File

@@ -49,14 +49,9 @@ export interface InferableComponentDecorator {
export declare function connect(): InferableComponentDecorator;
export declare function connect<TStateProps, TDispatchProps, TOwnProps>(
mapStateToProps: FuncOrSelf<MapStateToProps<TStateProps, TOwnProps>>,
mapDispatchToProps?: FuncOrSelf<MapDispatchToPropsFunction<TDispatchProps, TOwnProps> | MapDispatchToPropsObject>
): ComponentDecorator<TStateProps & TDispatchProps, TOwnProps>;
export declare function connect<TStateProps, TDispatchProps, TOwnProps>(
mapStateToProps: FuncOrSelf<MapStateToProps<TStateProps, TOwnProps>>,
mapDispatchToProps: FuncOrSelf<MapDispatchToPropsFunction<TDispatchProps, TOwnProps> | MapDispatchToPropsObject>,
mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps>,
mapStateToProps?: FuncOrSelf<MapStateToProps<TStateProps, TOwnProps>>,
mapDispatchToProps?: FuncOrSelf<MapDispatchToPropsFunction<TDispatchProps, TOwnProps> | MapDispatchToPropsObject>,
mergeProps?: MergeProps<TStateProps, TDispatchProps, TOwnProps>,
options?: Options
): ComponentDecorator<TStateProps & TDispatchProps, TOwnProps>;

View File

@@ -258,8 +258,9 @@ function mergeProps(stateProps: TodoState, dispatchProps: DispatchProps, ownProp
connect(mapStateToProps2, actionCreators, mergeProps)(TodoApp);
//https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14622#issuecomment-279820358
//Allow for undefined mapStateToProps
connect(undefined, mapDispatchToProps6)(TodoApp);
interface TestProp {
property1: number;