Noticed this while writing docs: ```js <ViewTransition onEnter={(instance) => { const anim = instance.new.animate(/* ... */); return () => { anim.cancel(); }; }} onExit={(instance) => { const anim = instance.new.animate(/* ... */); return () => { anim.cancel(); }; }} > {/* ... */} </ViewTransition> ``` If you have a pending`onEnter` animation and the tree is unmounted, the `onEnter` cleanup is called immediately. But if you have a pending `onExit` and the tree is unmounted, the `onExit` cleanup isn't called until the animation completes. This means you can't cancel the animation: https://github.com/user-attachments/assets/f522f746-5ed3-432f-acbf-d610ab4260d2 Sandbox: https://codesandbox.io/p/sandbox/naughty-wu-pfkh2m
Noticed this while writing docs:
If you have a pending
onEnteranimation and the tree is unmounted, theonEntercleanup is called immediately.But if you have a pending
onExitand the tree is unmounted, theonExitcleanup isn't called until the animation completes.This means you can't cancel the animation:
Screen.Recording.2026-02-21.at.11.11.57.AM.mov
Sandbox: https://codesandbox.io/p/sandbox/naughty-wu-pfkh2m