Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react three fiber set cursor pointer

const [hovered, setHovered] = useState(false);

useEffect(() => {
  document.body.style.cursor = hovered ? 'pointer' : 'auto'
  return ()=> document.body.style.cursor = 'auto';
}, [hovered])

return (
  <mesh
    onPointerOver={() => setHovered(true)}
    onPointerOut={() => setHovered(false)} />
Source by www.reddit.com #
 
PREVIOUS NEXT
Tagged: #react #fiber #set #cursor #pointer
ADD COMMENT
Topic
Name
4+7 =