Spaces:
Sleeping
Sleeping
File size: 344 Bytes
645859a |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import * as React from 'react';
function useCursor(hovered, onPointerOver = 'pointer', onPointerOut = 'auto', container = document.body) {
React.useEffect(() => {
if (hovered) {
container.style.cursor = onPointerOver;
return () => void (container.style.cursor = onPointerOut);
}
}, [hovered]);
}
export { useCursor };
|