frontend-opensource-project / use-react-hooks

React hoooooooks๐Ÿ˜Ž
https://frontend-opensource-project.github.io/use-react-hooks/
5 stars 0 forks source link

[URH-26] useHover ์‹ ๊ทœ #29

Closed bicochan closed 3 months ago

bicochan commented 3 months ago

๐Ÿ‘พ Pull Request

1๏ธโƒฃ Spec

2๏ธโƒฃ ๋ณ€๊ฒฝ ์‚ฌํ•ญ

3๏ธโƒฃ ์˜ˆ์‹œ ์ฝ”๋“œ

const Component = () => {
  const [ref, isHovered] = useHover();

  return (
    <div ref={ref} style={{ background: isHovered ? '#f00' : '#fff' }}>
      {isHovered ? 'Hovered!' : 'Not Hovered'}
    </div>
  );
};