mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-06 12:36:49 +08:00
Merge pull request #14623 from plee-nm/master
14622 Allow for mapStateToProps to be undefined.
This commit is contained in:
11
react-redux/index.d.ts
vendored
11
react-redux/index.d.ts
vendored
@@ -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>;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user