File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ declare module "unistore/react" {
1010 export function connect < T , S , K , I > (
1111 mapStateToProps : string | Array < string > | StateMapper < T , K , I > ,
1212 actions ?: ActionCreator < K > | object
13- ) : ( Child : ( ( props : T & I ) => React . ReactNode ) | React . Component < T , S > ) => React . Component < T , S > ;
13+ ) : ( Child : ( ( props : T & I ) => React . ReactNode ) | React . ComponentClass < T , S > ) => React . ComponentClass < T , S > ;
1414
1515 export interface ProviderProps < T > {
1616 store : Store < T > ;
@@ -19,7 +19,7 @@ declare module "unistore/react" {
1919 export class Provider < T > extends React . Component < ProviderProps < T > , { } > {
2020 render ( ) : React . ReactNode ;
2121 }
22-
22+
2323 interface ComponentConstructor < P = { } , S = { } > {
2424 new ( props : P , context ?: any ) : React . Component < P , S > ;
2525 }
Original file line number Diff line number Diff line change @@ -27,13 +27,11 @@ export function connect(mapStateToProps, actions) {
2727 let mapped = mapStateToProps ( store ? store . getState ( ) : { } , this . props ) ;
2828 for ( let i in mapped ) if ( mapped [ i ] !== state [ i ] ) {
2929 state = mapped ;
30- this . setState ( ) ;
31- return ;
30+ return this . setState ( ) ;
3231 }
3332 for ( let i in state ) if ( ! ( i in mapped ) ) {
3433 state = mapped ;
35- this . setState ( ) ;
36- return ;
34+ return this . setState ( ) ;
3735 }
3836 } ;
3937 this . componentWillReceiveProps = update ;
You can’t perform that action at this time.
0 commit comments