Closed nandorojo closed 1 year ago
Currently, we can use the custom prop with AnimatePresence to apply different exit animations based on some state value.
custom
AnimatePresence
const [pagination] = useState<1 | -1>(1) return ( <AnimatePresence custom={pagination}> {visible && ( <MotiView exit={(pagination) => { 'worklet' return { translateX: pagination * 10 } }} /> )} </AnimatePresence> )
However, we can't use this with exitTransition. It would be nice to do this for exitTransition too:
exitTransition
const [pagination] = useState<1 | -1>(1) return ( <AnimatePresence custom={pagination}> {visible && ( <MotiView exit={(pagination) => { 'worklet' return { translateX: pagination * 10 } }} exitTransition={(pagination) => { 'worklet' return { delay: pagination > 1 ? 100 : 400 } }} /> )} </AnimatePresence> )
Added in 0.19.x
0.19.x
Currently, we can use the
custom
prop withAnimatePresence
to apply different exit animations based on some state value.However, we can't use this with
exitTransition
. It would be nice to do this forexitTransition
too: