'Can't get AnimatePresence in Framer Motion to work
I've been trying to get <AnimatePresence> from Framer Motion to work. But for some reason, I can't get it to work. I want to have an exit animation for a mobile navbar.
Here's a screenshot of the code:

Here's the animation variables:

It animates when en entering the DOM, but there's no animation when it leaves. Any help is greatly appreciated!
I've tried moving the different components around, but nothing seems to work.
Solution 1:[1]
From the Framer docs:
Child
motioncomponents must each have a uniquekeyprop soAnimatePresencecan track their presence in the tree.
You need to add a unique key prop to your m.ul element.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Cadin |
