Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 1.63 KB

File metadata and controls

9 lines (6 loc) · 1.63 KB

useHover hard #react #event listeners #hooks

by Pawan Kumar @jsartisan

Take the Challenge

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();

Back Share your Solutions Check out Solutions