A simple way to manage global DOM events in React with hooks
Creating UI components like dialog, modal, or drawers mostly requires adding keyboard accessibilities like closing them when ESC (escape) key is pressed, and doing that may require you to attach an event listener for keyup event inside use useEffect ...
Nov 8, 20204 min read87
