Custom Hot Keys With Vanilla JS In A React Hooks App

Skip the library and roll your own hot keys

GreekDataGuy
JavaScript in Plain English
2 min readNov 18, 2020

--

Photo by Pixabay from Pexels

While working on a React app, I needed to hide a component when a user pressed the escape key.

A quick google search for “react custom hot keys” recommended a library called react-hotkeys.

--

--