mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
add test for withHandlers too
This commit is contained in:
@@ -119,6 +119,11 @@ function testWithHandlers() {
|
||||
out={42}
|
||||
/>
|
||||
)
|
||||
|
||||
const handlerNameTypecheckProof = withHandlers<OutterProps, HandlerProps>((props) => ({ // $ExpectError
|
||||
onChange: () => () => {}, // $ExpectError
|
||||
notAKeyOnHandlerProps: () => () => {}, // $ExpectError
|
||||
})); // $ExpectError
|
||||
}
|
||||
|
||||
function testDefaultProps() {
|
||||
@@ -211,7 +216,7 @@ function testWithStateHandlers() {
|
||||
<Enhanced initialCounter={4} power={2} />
|
||||
);
|
||||
|
||||
const broken = withStateHandlers<State, Updaters, OutterProps>(
|
||||
const updateNameTypecheckProof = withStateHandlers<State, Updaters, OutterProps>(
|
||||
(props: OutterProps) => ({ counter: props.initialCounter }),
|
||||
{ notAKeyOfUpdaters: (state, props) => n => ({ ...state, counter: state.counter + n ** props.power }), }, // $ExpectError
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user