You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@abernier I see ... wrapping my head around how to update state outside of useFrame - although it's unclear to me if that's directly related to this issue. If I set state intermittently, not every frame, it looks like it would cause the transformcontrols to break the dragging behavior on that frame
Codesandbox to reproduce: https://codesandbox.io/p/sandbox/react-three-fiber-forked-8tqxgj?file=%2Fsrc%2Fcomponents%2FBox.jsx%3A1%2C1-23%2C1
three
version: 0.170.0@react-three/fiber
version: 8.17.10@react-three/drei
version: 9.117.0node
version: n/anpm
(oryarn
) version: n/aProblem description:
TransformControls don't work when you call
setState
inuseFrame
, including both react and zustand setters.Hovering over the transform controls results in flickering, and they aren't draggable.
Relevant code:
Suggested solution:
This should(?) work out of the box? Removing the
setState
causes it to work, but that is not an acceptable solution.I note this does work if you move the
useFrame()
to thePlane.js
component in the scene above - aka if it's in a sibling component.This does not work if the parent component of the one containing the
<TransformControls />
contains the useFrame/setState.This also does not work if you add a
key={0}
prop to the TransformControls, which I tried to see if it's from mounting/unmounting.The text was updated successfully, but these errors were encountered: