I am trying to put my keyup event with TS but using any|KeyboardEvent
does not work.
How to type events in React?
TS Error
Type '(e: KeyboardEvent) => void' is not assignable to type 'KeyboardEventHandler<HTMLInputElement>'.
Types of parameters 'e' and 'event' are incompatible.
Type 'KeyboardEvent<HTMLInputElement>' is missing the following properties from type 'KeyboardEvent': char, isComposing, DOM_KEY_LOCATION_LEFT, DOM_KEY_LOCATION_NUMPAD, and 15 more. TS2322
Component
<input
type="text"
placeholder="Search for claim ID"
onKeyUp={(e: KeyboardEvent) => {
console.info();
}}
/>