@@ -33,7 +33,15 @@ import type ReanimatedModalProps from './ReanimatedModal/types';
3333import type BaseModalProps from './types' ;
3434import type { FocusTrapOptions } from './types' ;
3535
36- const REANIMATED_MODAL_TYPES : Array < ValueOf < typeof CONST . MODAL . MODAL_TYPE > > = [ CONST . MODAL . MODAL_TYPE . BOTTOM_DOCKED , CONST . MODAL . MODAL_TYPE . FULLSCREEN , CONST . MODAL . MODAL_TYPE . POPOVER ] ;
36+ const REANIMATED_MODAL_TYPES : Array < ValueOf < typeof CONST . MODAL . MODAL_TYPE > > = [
37+ CONST . MODAL . MODAL_TYPE . BOTTOM_DOCKED ,
38+ CONST . MODAL . MODAL_TYPE . FULLSCREEN ,
39+ CONST . MODAL . MODAL_TYPE . POPOVER ,
40+ CONST . MODAL . MODAL_TYPE . CENTERED ,
41+ CONST . MODAL . MODAL_TYPE . CENTERED_SMALL ,
42+ CONST . MODAL . MODAL_TYPE . CENTERED_UNSWIPEABLE ,
43+ CONST . MODAL . MODAL_TYPE . CENTERED_SWIPEABLE_TO_RIGHT ,
44+ ] ;
3745
3846type ModalComponentProps = ( ReactNativeModalProps | ReanimatedModalProps ) & {
3947 type ?: ValueOf < typeof CONST . MODAL . MODAL_TYPE > ;
@@ -374,7 +382,8 @@ function BaseModal(
374382 ) ;
375383
376384 const animationInProps = useMemo ( ( ) => {
377- if ( disableAnimationIn ) {
385+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
386+ if ( disableAnimationIn || ( type && REANIMATED_MODAL_TYPES . includes ( type ) ) || shouldUseReanimatedModal ) {
378387 // We need to apply these animation props to completely disable the "animation in". Simply setting it to 0 and undefined will not work.
379388 // Based on: https://github.com/react-native-modal/react-native-modal/issues/191
380389 return {
@@ -388,7 +397,7 @@ function BaseModal(
388397 animationInDelay,
389398 animationInTiming,
390399 } ;
391- } , [ animationIn , animationInDelay , animationInTiming , disableAnimationIn , modalStyleAnimationIn ] ) ;
400+ } , [ animationIn , animationInDelay , animationInTiming , disableAnimationIn , modalStyleAnimationIn , shouldUseReanimatedModal , type ] ) ;
392401
393402 // In Modals we need to reset the ScreenWrapperOfflineIndicatorContext to allow nested ScreenWrapper components to render offline indicators,
394403 // except if we are in a narrow pane navigator. In this case, we use the narrow pane's original values.
0 commit comments