Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const someEvent: React.KeyboardEvent<HTMLTextAreaElement>;
- console.log(typeof someEvent.key); // output: string
- enum VK {
- ENTER = "Enter",
- BACKSPACE = "Backspace",
- LEFT = "ArrowLeft",
- ....
- }
- if (someEvent.key === VK.ENTER) { ... }
Add Comment
Please, Sign In to add comment