Skip to content

Instantly share code, notes, and snippets.

View Guria's full-sized avatar

Aleksei Gurianov Guria

View GitHub Profile
@Guria
Guria / use-hover-example.js
Last active October 30, 2018 16:31 — forked from gragland/use-hover-example.js
React Hook recipe from https://usehooks.com
import { useRef, useState, useEffect } from 'react';
// Usage
function App() {
const [ref, isHovered] = useHover(ref);
return (
<div ref={ref}>
{isHovered ? '😁' : '☹️'}
</div>