Can you get a ref for the <Canvas /> with TypeScript? #1017
-
Hi, is there a way to get a ref to the DOM of the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Are you referring to the dom const { gl } = useThree()
React.useEffect(() => {
console.log(gl.domElement) // will show me the `<canvas>` dom element.
}, []) |
Beta Was this translation helpful? Give feedback.
-
@joshuaellis |
Beta Was this translation helpful? Give feedback.
Are you referring to the dom
<canvas>
element or it's container? the<canvas>
dom element can be accessed using theuseThree
hook: