Skip to content

Commit

Permalink
fix: stop all AnimationActions on unmount/mixer change (#1176)
Browse files Browse the repository at this point in the history
  • Loading branch information
trebeljahr committed Dec 15, 2022
1 parent 57d95f1 commit 16f1caf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/useAnimations.tsx
Expand Up @@ -49,5 +49,12 @@ export function useAnimations<T extends AnimationClip>(
})
}
}, [clips])

React.useEffect(() => {
return () => {
mixer.stopAllAction()
}
}, [mixer])

return api
}

1 comment on commit 16f1caf

@vercel
Copy link

@vercel vercel bot commented on 16f1caf Dec 15, 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.