|
1 | 1 | import React, {useEffect, useMemo, useRef} from 'react'; |
2 | | -import Animated, {Keyframe, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; |
| 2 | +import Animated, {Keyframe, ReduceMotion, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'; |
3 | 3 | import type ReanimatedModalProps from '@components/Modal/ReanimatedModal/types'; |
4 | 4 | import type {ContainerProps} from '@components/Modal/ReanimatedModal/types'; |
5 | 5 | import {easing, getModalInAnimationStyle, getModalOutAnimation} from '@components/Modal/ReanimatedModal/utils'; |
@@ -37,12 +37,15 @@ function Container({ |
37 | 37 | // instead of an entering transition since keyframe animations break keyboard on mWeb Chrome (#62799) |
38 | 38 | const animatedStyles = useAnimatedStyle(() => getModalInAnimationStyle(animationIn)(initProgress.get()), [initProgress]); |
39 | 39 |
|
40 | | - const Exiting = useMemo(() => { |
41 | | - const AnimationOut = new Keyframe(getModalOutAnimation(animationOut)); |
42 | | - |
43 | | - // eslint-disable-next-line react-compiler/react-compiler |
44 | | - return AnimationOut.duration(animationOutTiming).withCallback(() => onCloseCallbackRef.current()); |
45 | | - }, [animationOutTiming, animationOut]); |
| 40 | + const Exiting = useMemo( |
| 41 | + () => |
| 42 | + new Keyframe(getModalOutAnimation(animationOut)) |
| 43 | + .duration(animationOutTiming) |
| 44 | + // eslint-disable-next-line react-compiler/react-compiler |
| 45 | + .withCallback(() => onCloseCallbackRef.current()) |
| 46 | + .reduceMotion(ReduceMotion.Never), |
| 47 | + [animationOutTiming, animationOut], |
| 48 | + ); |
46 | 49 |
|
47 | 50 | return ( |
48 | 51 | <Animated.View |
|
0 commit comments