Initial project import
This commit is contained in:
12
node_modules/@react-three/drei/web/useCursor.js
generated
vendored
Normal file
12
node_modules/@react-three/drei/web/useCursor.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user