Loading...
Loading...
Create a custom React hook useHover that tracks whether the cursor is hovering over an element. Requirements: ✓ Hook should return an array: [ref, isHovered] ✓ ref - reference to DOM element ✓ isHovered - boolean, true if cursor is over the element ✓ Use mouseenter and mouseleave events ✓ Clean up listeners on unmount ✓ Work with any HTML elements Acceptance Criteria: ✓ Hook correctly determines hover state ✓ No memory leaks (listeners are cleaned up) ✓ Can be used on multiple elements simultaneously ✓ Demonstration with examples (buttons, cards, images)