Skip to content

Commit

Permalink
fix: remove TransformControls events from cleanup (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlaricBaraou committed Dec 7, 2022
1 parent f47a8fd commit 5f6aef7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/TransformControls.tsx
Expand Up @@ -91,10 +91,10 @@ export const TransformControls = React.forwardRef<TransformControlsImpl, Transfo
const onMouseUpRef = React.useRef<(e?: THREE.Event) => void>()
const onObjectChangeRef = React.useRef<(e?: THREE.Event) => void>()

React.useLayoutEffect(() => (onChangeRef.current = onChange), [onChange])
React.useLayoutEffect(() => (onMouseDownRef.current = onMouseDown), [onMouseDown])
React.useLayoutEffect(() => (onMouseUpRef.current = onMouseUp), [onMouseUp])
React.useLayoutEffect(() => (onObjectChangeRef.current = onObjectChange), [onObjectChange])
React.useLayoutEffect(() => void (onChangeRef.current = onChange), [onChange])
React.useLayoutEffect(() => void (onMouseDownRef.current = onMouseDown), [onMouseDown])
React.useLayoutEffect(() => void (onMouseUpRef.current = onMouseUp), [onMouseUp])
React.useLayoutEffect(() => void (onObjectChangeRef.current = onObjectChange), [onObjectChange])

React.useEffect(() => {
const onChange = (e: THREE.Event) => {
Expand Down

1 comment on commit 5f6aef7

@vercel
Copy link

@vercel vercel bot commented on 5f6aef7 Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.