couds / react-bulma-components

React components for Bulma framework
MIT License
1.2k stars 126 forks source link

Button onClick callback does not take event as an argument #321

Closed sszczep closed 3 years ago

sszczep commented 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'.

Temporary solve onClick={onButtonClick as any}

couds commented 3 years ago

Hi @sszczep Thanks for reporting. just deployed v4.0.2 fixing this issue