Replies: 3 comments 2 replies
-
|
You can use "React Intersection Observer" to exit . Cos it always work for me . |
Beta Was this translation helpful? Give feedback.
-
|
https://codesandbox.io/p/sandbox/suspicious-cloud-z8mfnp?file=%2Fsrc%2FApp.tsx%3A32%2C39 @Inzendis you can try this out, works for me The reason why its not working for you is because you're rendering the AnimatePresence wrapper conditionally, so when the state becomes false, it gets unmounted and as a result, the exit animation doesn't trigger |
Beta Was this translation helpful? Give feedback.
-
Its working for as this |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So pretty much it works as intented except for the Exit.
I made sure to use "AnimatePresence" before the condition and I gave a unique key to motion.div.
At least to what I have read I have everything set correctly? If someone can help me that would be awesome!
Beta Was this translation helpful? Give feedback.
All reactions