nandorojo / moti

🐼 The React Native (+ Web) animation library, powered by Reanimated 3.
https://moti.fyi
MIT License
3.9k stars 120 forks source link

AnimatePresence mode="wait" vs exitBeforeEnter #340

Closed MarchewkaMatthew closed 2 months ago

MarchewkaMatthew commented 2 months ago

Is there an existing issue for this?

Do you want this issue prioritized?

Current Behavior

After the initial setup, I tried to use AnimatePresence together with some basic enter and exit animations. I was trying to use the "exitBeforeEnter" prop described in the documentation. After opening the app I received an error that I should replace exitBeforeEnter with mode="wait". After I replaced the prop animations started to work, but the typescript is reporting that the given prop is not existing in the type.

Expected Behavior

Prop types are updated to match the current AnimatePresence logic.

Steps To Reproduce

  1. Install Moti following this tutorial: https://moti.fyi/installation
  2. Add <AnimatePresence> component to your project together with some <MotiView> in it
  3. Use the "exitBeforeEnter" prop and open the app
  4. App Should report render error

Versions

- Moti: 0.28.1
- Reanimated: 3.6.3
- React Native: 0.73.4
- Framer motion: 6.5.1

Screenshots

image

image

Reproduction

  1. Install Moti following this tutorial: https://moti.fyi/installation
  2. Add <AnimatePresence> component to your project together with some <MotiView> in it
  3. Use the "exitBeforeEnter" prop and open the app
  4. App Should report render error
MarchewkaMatthew commented 2 months ago

It seems that reason behind this problem, was another dependency which was overriding framer-motion version, closing as not planned.