Replies: 1 comment
-
as a rule of thumb, never setstate animations or often occuring events in react. you can use zustand or just plain refs, anything that avoids calling react so often: https://github.com/react-spring/react-three-fiber/blob/master/pitfalls.md im not sure i understand the dragging part. you have pointer events: https://github.com/react-spring/react-three-fiber/blob/master/api.md#events if you drag something you want to capture the event on pointerDown so that pointerMove will file regardless if the mouse is precisely pver the object or leaves the window. react-use-gesture would do the same thing. here's an example: https://codesandbox.io/s/r3f-lines-capture-1gkvp but you still need to shut down controls if you detect drag. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions