diff --git a/types/recompose/index.d.ts b/types/recompose/index.d.ts index 0c7b9089c6..0c893486c3 100644 --- a/types/recompose/index.d.ts +++ b/types/recompose/index.d.ts @@ -141,7 +141,7 @@ declare module 'recompose' { stateUpdaterName: TStateUpdaterName, initialState: TState | mapper ): InferableComponentEnhancerWithProps< - stateProps, + TOutter & stateProps, TOutter >; diff --git a/types/recompose/recompose-tests.tsx b/types/recompose/recompose-tests.tsx index 75d64b468d..c30f5fb8f9 100644 --- a/types/recompose/recompose-tests.tsx +++ b/types/recompose/recompose-tests.tsx @@ -256,6 +256,15 @@ function testWithState() { const rendered2 = ( ); + + // We can also actually provide the generic necessary + const enhancer3 = withState("count", "setCount", 1); + const Enhanced3 = enhancer3(props => { + return
{props.title}
; + }); + const rendered3 = ( + + ); } function testWithStateHandlers() {