Closed sszczep closed 3 years ago
Describe the bug We should have an access to the event argument in the onClick callback.
Code
const onButtonClick = async(event: React.MouseEvent<HTMLElement>) => {} ... <Button onClick={onButtonClick}>I'm not working</Button>
Error message Type '(event: React.MouseEvent<HTMLElement>) => Promise<void>' is not assignable to type '() => void'.
Type '(event: React.MouseEvent<HTMLElement>) => Promise<void>' is not assignable to type '() => void'.
Temporary solve onClick={onButtonClick as any}
onClick={onButtonClick as any}
Hi @sszczep Thanks for reporting. just deployed v4.0.2 fixing this issue
Describe the bug We should have an access to the event argument in the onClick callback.
Code
Error message
Type '(event: React.MouseEvent<HTMLElement>) => Promise<void>' is not assignable to type '() => void'.
Temporary solve
onClick={onButtonClick as any}