22
rated 0 times
[
27]
[
5]
/ answers: 1 / hits: 29514
/ 4 Years ago, wed, january 15, 2020, 12:00:00
I want to use a type for my event handler instead of using type any,
Can anyone help me with this,please?
here is the code I'm trying to refactor:
const MyComponent = () => {
const handleBtnClick = (e: any) => {
e.stopPropagation();
//**Some Code**
}
return <CustomButton onClick={handleBtnClick} />
}
More From » reactjs