diff --git a/src/AsyncButton.tsx b/src/AsyncButton.tsx index 6004d4b..14ea9ce 100644 --- a/src/AsyncButton.tsx +++ b/src/AsyncButton.tsx @@ -35,7 +35,9 @@ const AsyncButton = React.forwardRef( }: AsyncButtonProps, ref?: PolymorphicRef, ) => { - const [buttonState, setButtonState] = useState(STATES.INIT); + const [buttonState, setButtonState] = useState<(typeof STATES)[keyof typeof STATES]>( + STATES.INIT, + ); const cancellablePromise = useRef>(); const timeout = useRef>();