Skip to content

Commit fd10410

Browse files
zoontekmeta-codesync[bot]
authored andcommitted
Remove Modal animated prop (#57385)
Summary: Removes the deprecated `animated` prop from `Modal`. It was a no-op everywhere. Use `animationType` instead. See #57384 ## Changelog: [GENERAL] [REMOVED] - Remove deprecated `Modal` `animated` prop Pull Request resolved: #57385 Test Plan: - `yarn jest packages/react-native/Libraries/Modal` - `yarn flow` and `tsc` pass with the prop removed from `Modal.js` / `Modal.d.ts`. Reviewed By: huntie Differential Revision: D110205204 Pulled By: cortinico fbshipit-source-id: 8e5b4d7dc8811d7270de3776476e7f868eafddd5
1 parent 400c3e0 commit fd10410

13 files changed

Lines changed: 4 additions & 47 deletions

File tree

packages/react-native/Libraries/Modal/Modal.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ import {NativeSyntheticEvent} from '../Types/CoreEventTypes';
1313
import {ColorValue} from '../StyleSheet/StyleSheet';
1414

1515
export interface ModalBaseProps {
16-
/**
17-
* @deprecated Use animationType instead
18-
*/
19-
animated?: boolean | undefined;
2016
/**
2117
* The `animationType` prop controls how the modal animates.
2218
*

packages/react-native/Libraries/Modal/Modal.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ type OrientationChangeEvent = Readonly<{
5959

6060
/** @build-types emit-as-interface Uniwind compatibility */
6161
export type ModalBaseProps = {
62-
/**
63-
* @deprecated Use `animationType` instead.
64-
*/
65-
animated?: boolean,
66-
6762
/**
6863
* Controls how the modal animates. `'slide'` slides in from the bottom,
6964
* `'fade'` fades into view, `'none'` appears without animation.

packages/react-native/Libraries/Modal/__tests__/Modal-itest.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -301,24 +301,6 @@ describe('<Modal>', () => {
301301
);
302302
});
303303
});
304-
305-
describe('animated', () => {
306-
[true, false].forEach(animated => {
307-
// The 'animated' prop is deprecated and ignored when the Modal is rendered
308-
// Users should use the 'animationType' prop instead.
309-
it(`[DEPRECATED] renders a Modal with animated="${animated ? 'true' : 'false'}"`, () => {
310-
Fantom.runTask(() => {
311-
root.render(<Modal animated={animated} />);
312-
});
313-
314-
expect(root.getRenderedOutput({props: ['animated']}).toJSX()).toEqual(
315-
<rn-modalHostView>
316-
<rn-view />
317-
</rn-modalHostView>,
318-
);
319-
});
320-
});
321-
});
322304
// ... more props
323305
});
324306
describe('ref', () => {

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5096,7 +5096,6 @@ public class com/facebook/react/viewmanagers/ModalHostViewManagerDelegate : com/
50965096

50975097
public abstract interface class com/facebook/react/viewmanagers/ModalHostViewManagerInterface : com/facebook/react/uimanager/ViewManagerWithGeneratedInterface {
50985098
public abstract fun setAllowSwipeDismissal (Landroid/view/View;Z)V
5099-
public abstract fun setAnimated (Landroid/view/View;Z)V
51005099
public abstract fun setAnimationType (Landroid/view/View;Ljava/lang/String;)V
51015100
public abstract fun setHardwareAccelerated (Landroid/view/View;Z)V
51025101
public abstract fun setIdentifier (Landroid/view/View;I)V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ internal class ReactModalHostManager :
7272
@ReactProp(name = "presentationStyle")
7373
override fun setPresentationStyle(view: ReactModalHostView, value: String?): Unit = Unit
7474

75-
@ReactProp(name = "animated")
76-
override fun setAnimated(view: ReactModalHostView, value: Boolean): Unit = Unit
77-
7875
@ReactProp(name = "supportedOrientations")
7976
override fun setSupportedOrientations(view: ReactModalHostView, value: ReadableArray?): Unit =
8077
Unit

packages/react-native/ReactNativeApi.d.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<42200de8ca10d30541e23b67547d9a13>>
7+
* @generated SignedSource<<20bbe8284af4b8863a39651a46b7a53a>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -3098,7 +3098,6 @@ declare type Message = {
30983098
}
30993099
declare type Modal = typeof Modal
31003100
declare interface ModalBaseProps {
3101-
animated?: boolean
31023101
animationType?: "fade" | "none" | "slide"
31033102
backdropColor?: ColorValue
31043103
modalRef?: React.Ref<ModalInstance>
@@ -6038,10 +6037,10 @@ export {
60386037
MeasureInWindowOnSuccessCallback, // a285f598
60396038
MeasureLayoutOnSuccessCallback, // 3592502a
60406039
MeasureOnSuccessCallback, // 82824e59
6041-
Modal, // c8c01498
6042-
ModalBaseProps, // 71945951
6040+
Modal, // 43f50013
6041+
ModalBaseProps, // ac3931ad
60436042
ModalInstance, // d466ce77
6044-
ModalProps, // 9f060027
6043+
ModalProps, // 35252d68
60456044
ModalPropsAndroid, // 515fb173
60466045
ModalPropsIOS, // 0e13cfcc
60476046
ModeChangeEvent, // f64bf69d

packages/react-native/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ type RCTModalHostViewNativeProps = Readonly<{
107107
*/
108108
visible?: WithDefault<boolean, false>,
109109

110-
/**
111-
* Deprecated. Use the `animationType` prop instead.
112-
*/
113-
animated?: WithDefault<boolean, false>,
114-
115110
/**
116111
* Controls whether the modal can be dismissed by swiping down on iOS.
117112
* This requires you to implement the `onRequestClose` prop to handle the dismissal.

scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3350,7 +3350,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
33503350
public ModalHostViewProps() = default;
33513351
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
33523352
public bool allowSwipeDismissal;
3353-
public bool animated;
33543353
public bool hardwareAccelerated;
33553354
public bool navigationBarTranslucent;
33563355
public bool statusBarTranslucent;

scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3252,7 +3252,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
32523252
public ModalHostViewProps() = default;
32533253
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
32543254
public bool allowSwipeDismissal;
3255-
public bool animated;
32563255
public bool hardwareAccelerated;
32573256
public bool navigationBarTranslucent;
32583257
public bool statusBarTranslucent;

scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3347,7 +3347,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
33473347
public ModalHostViewProps() = default;
33483348
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
33493349
public bool allowSwipeDismissal;
3350-
public bool animated;
33513350
public bool hardwareAccelerated;
33523351
public bool navigationBarTranslucent;
33533352
public bool statusBarTranslucent;

0 commit comments

Comments
 (0)