3 - useHover

medium
react
event listeners
hooks

Implment a custom hook useHover that returns a ref and a boolean indicating whether the element with that ref is hovered or not. When the element is hovered, the hook should set the boolean to true.

const { hovered, ref } = useHover();

⚙️

Booting up the editor...

Please wait while we load the editor.

⚙️

Loading Preview...