Different transition for exit animation in Framer Motion

Viewed 597

How can I achieve a different type of transition for an exit property in Framer Motion?

<motion.div
  initial={{opacity: 0, transform: 'scale(0.5)'}}
  animate={{opacity: 1, transform: 'scale(1)'}}
  exit={{opacity: 0, transform: 'scale(0.5)'}}
  /* I want "type" to be different only for the exit animation */
  transition={{ type: "spring", stiffness: 200 }}
></motion.div>

I want the "spring" transition to be used for initial and animate, but for exit I want a different type. Exit animation is working (I am using <AnimatePresence> wrapper, but I just want a different behaviour for exit.

0 Answers
Related