It seems pretty simple but I can't handle this problem I always get same message in console:
Type error: Type '(event: MouseEvent) => void' is not assignable to type '() => Event'. TS2322
This is my code:
//in one class
//some code
render()
return (
<div className={keyStyle} key={key} onClick={() => this.props.turnKey()}></div>
)
//in other classs
//some code
return (
<div className="container">
<Display />
<Keys turnKey={this.activateKey}/>
</div>
);
}
activateKey = (event : React.MouseEvent): void =>{
console.log(event.target);
}
How do I solve this error?