Lets say we have a swap animation using AnimatePresence and it animates the swapping of 2 divs.
now when div a is entering and div b is exiting and I trigger the swapping again, it forgets to remove the now exiting div a.
or sometimes it works correctly but the next time triggering the animation both elements show up at the same time.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
1. Read the FAQs 👇 done 2. Describe the bug
Lets say we have a swap animation using AnimatePresence and it animates the swapping of 2 divs. now when div a is entering and div b is exiting and I trigger the swapping again, it forgets to remove the now exiting div a. or sometimes it works correctly but the next time triggering the animation both elements show up at the same time.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
https://codesandbox.io/p/sandbox/framer-motion-bug-rmgdpz
4. Steps to reproduce
Click "change" Then click it again while both elements are animating. It all breaks
5. Expected behaviour
Simply exit and unmount the exited element