File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export interface WithBreakpoint {
8
8
matchBreakpoint : boolean ;
9
9
}
10
10
11
- function makeResponsive < Props > (
11
+ function makeResponsive < Props extends WithBreakpoint > (
12
12
WrappedComponent : React . ComponentType < Props > ,
13
13
mediaQuery : string | QueryObject | QueryObject [ ] ,
14
14
) : React . ComponentType < Omit < Props , keyof WithBreakpoint > > {
@@ -43,8 +43,11 @@ function makeResponsive<Props>(
43
43
} ;
44
44
45
45
render ( ) {
46
- // @ts -ignore TODO: Figure out what's wrong here
47
- return < WrappedComponent matchBreakpoint = { this . state . matchBreakpoint } { ...this . props } /> ;
46
+ return (
47
+ // TODO: remove as Props hack as defined in:
48
+ // https://github.com/Microsoft/TypeScript/issues/28938#issuecomment-450636046
49
+ < WrappedComponent { ...this . props as Props } matchBreakpoint = { this . state . matchBreakpoint } />
50
+ ) ;
48
51
}
49
52
} ;
50
53
}
Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ function withTimer<Props extends TimerData>(
53
53
} ;
54
54
55
55
render ( ) {
56
- // @ts -ignore TODO: Figure out what's wrong here
57
- return < WrappedComponent { ...this . state } { ...this . props } /> ;
56
+ // TODO: remove as Props hack as defined in:
57
+ // https://github.com/Microsoft/TypeScript/issues/28938#issuecomment-450636046
58
+ return < WrappedComponent { ...this . state } { ...this . props as Props } /> ;
58
59
}
59
60
} ;
60
61
}
You can’t perform that action at this time.
0 commit comments