Ref Type Error on click #1944
-
Hello I'm pretty new to React three Fiber and I'm currently working on animating a mesh using Refs as per documentation. I'm building a plane geometry with animations that makes my geometry float and hover according to the mouse position. Just like this site. I have most of the animation down except for one part. If you click anywhere on the page, the plane is supposed to snap back into place momentarily, before slipping back into a floating state. Here is a codesandbox of my code I am however running into a Type error when I click on the page telling me that my ref is undefined. I have been trying to anything I can to get to the bottom of it but to no avail. I would appreciate any help or feedback with this issue |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not sure you need to involve the ref for that, here's one option: https://codesandbox.io/s/kid-warped-planes-forked-sd2te?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
I'm not sure you need to involve the ref for that, here's one option: https://codesandbox.io/s/kid-warped-planes-forked-sd2te?file=/src/App.js