From 487573424c62790d1ede4abc9a99a44ba84f3d0f Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Sat, 5 Aug 2023 06:29:40 +0200 Subject: [PATCH] WIP: Upgrade to THREE.r155 - Fix the bug with TransformControls Prior to this, any change caused by TransformControls would cause the SnapshotEditor's frameloop to halt --- packages/r3f/src/extension/components/TransformControls.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/r3f/src/extension/components/TransformControls.tsx b/packages/r3f/src/extension/components/TransformControls.tsx index 6145401..578d5c1 100644 --- a/packages/r3f/src/extension/components/TransformControls.tsx +++ b/packages/r3f/src/extension/components/TransformControls.tsx @@ -49,8 +49,8 @@ const TransformControls = forwardRef( }, [object, controls]) useEffect(() => { - controls?.addEventListener?.('change', invalidate) - return () => controls?.removeEventListener?.('change', invalidate) + controls?.addEventListener?.('change', () => invalidate()) + return () => controls?.removeEventListener?.('change', () => invalidate()) }, [controls, invalidate]) useEffect(() => {