mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove Modal animated prop (#57385)
Summary: Removes the deprecated `animated` prop from `Modal`. It was a no-op everywhere. Use `animationType` instead. See https://github.com/react/react-native/issues/57384 ## Changelog: [GENERAL] [REMOVED] - Remove deprecated `Modal` `animated` prop Pull Request resolved: https://github.com/react/react-native/pull/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
This commit is contained in:
1 parent
400c3e0f83
commit
fd10410d51
13 files changed
+4
-47
No files matched your search
@@ -13,10 +13,6 @@ import {NativeSyntheticEvent} from '../Types/CoreEventTypes';
|
||||
import {ColorValue} from '../StyleSheet/StyleSheet';
|
||||
|
||||
export interface ModalBaseProps {
|
||||
/**
|
||||
* @deprecated Use animationType instead
|
||||
*/
|
||||
animated?: boolean | undefined;
|
||||
/**
|
||||
* The `animationType` prop controls how the modal animates.
|
||||
*
|
||||
|
||||
@@ -59,11 +59,6 @@ type OrientationChangeEvent = Readonly<{
|
||||
|
||||
/** @build-types emit-as-interface Uniwind compatibility */
|
||||
export type ModalBaseProps = {
|
||||
/**
|
||||
* @deprecated Use `animationType` instead.
|
||||
*/
|
||||
animated?: boolean,
|
||||
|
||||
/**
|
||||
* Controls how the modal animates. `'slide'` slides in from the bottom,
|
||||
* `'fade'` fades into view, `'none'` appears without animation.
|
||||
|
||||
@@ -301,24 +301,6 @@ describe('<Modal>', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('animated', () => {
|
||||
[true, false].forEach(animated => {
|
||||
// The 'animated' prop is deprecated and ignored when the Modal is rendered
|
||||
// Users should use the 'animationType' prop instead.
|
||||
it(`[DEPRECATED] renders a Modal with animated="${animated ? 'true' : 'false'}"`, () => {
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal animated={animated} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['animated']}).toJSX()).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
// ... more props
|
||||
});
|
||||
describe('ref', () => {
|
||||
|
||||
@@ -5096,7 +5096,6 @@ public class com/facebook/react/viewmanagers/ModalHostViewManagerDelegate : com/
|
||||
|
||||
public abstract interface class com/facebook/react/viewmanagers/ModalHostViewManagerInterface : com/facebook/react/uimanager/ViewManagerWithGeneratedInterface {
|
||||
public abstract fun setAllowSwipeDismissal (Landroid/view/View;Z)V
|
||||
public abstract fun setAnimated (Landroid/view/View;Z)V
|
||||
public abstract fun setAnimationType (Landroid/view/View;Ljava/lang/String;)V
|
||||
public abstract fun setHardwareAccelerated (Landroid/view/View;Z)V
|
||||
public abstract fun setIdentifier (Landroid/view/View;I)V
|
||||
|
||||
-3
@@ -72,9 +72,6 @@ internal class ReactModalHostManager :
|
||||
@ReactProp(name = "presentationStyle")
|
||||
override fun setPresentationStyle(view: ReactModalHostView, value: String?): Unit = Unit
|
||||
|
||||
@ReactProp(name = "animated")
|
||||
override fun setAnimated(view: ReactModalHostView, value: Boolean): Unit = Unit
|
||||
|
||||
@ReactProp(name = "supportedOrientations")
|
||||
override fun setSupportedOrientations(view: ReactModalHostView, value: ReadableArray?): Unit =
|
||||
Unit
|
||||
|
||||
+4
-5
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<42200de8ca10d30541e23b67547d9a13>>
|
||||
* @generated SignedSource<<20bbe8284af4b8863a39651a46b7a53a>>
|
||||
*
|
||||
* This file was generated by scripts/js-api/build-types/index.js.
|
||||
*/
|
||||
@@ -3098,7 +3098,6 @@ declare type Message = {
|
||||
}
|
||||
declare type Modal = typeof Modal
|
||||
declare interface ModalBaseProps {
|
||||
animated?: boolean
|
||||
animationType?: "fade" | "none" | "slide"
|
||||
backdropColor?: ColorValue
|
||||
modalRef?: React.Ref<ModalInstance>
|
||||
@@ -6038,10 +6037,10 @@ export {
|
||||
MeasureInWindowOnSuccessCallback, // a285f598
|
||||
MeasureLayoutOnSuccessCallback, // 3592502a
|
||||
MeasureOnSuccessCallback, // 82824e59
|
||||
Modal, // c8c01498
|
||||
ModalBaseProps, // 71945951
|
||||
Modal, // 43f50013
|
||||
ModalBaseProps, // ac3931ad
|
||||
ModalInstance, // d466ce77
|
||||
ModalProps, // 9f060027
|
||||
ModalProps, // 35252d68
|
||||
ModalPropsAndroid, // 515fb173
|
||||
ModalPropsIOS, // 0e13cfcc
|
||||
ModeChangeEvent, // f64bf69d
|
||||
|
||||
Vendored
-5
@@ -107,11 +107,6 @@ type RCTModalHostViewNativeProps = Readonly<{
|
||||
*/
|
||||
visible?: WithDefault<boolean, false>,
|
||||
|
||||
/**
|
||||
* Deprecated. Use the `animationType` prop instead.
|
||||
*/
|
||||
animated?: WithDefault<boolean, false>,
|
||||
|
||||
/**
|
||||
* Controls whether the modal can be dismissed by swiping down on iOS.
|
||||
* This requires you to implement the `onRequestClose` prop to handle the dismissal.
|
||||
|
||||
@@ -3350,7 +3350,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
|
||||
public ModalHostViewProps() = default;
|
||||
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
|
||||
public bool allowSwipeDismissal;
|
||||
public bool animated;
|
||||
public bool hardwareAccelerated;
|
||||
public bool navigationBarTranslucent;
|
||||
public bool statusBarTranslucent;
|
||||
|
||||
@@ -3252,7 +3252,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
|
||||
public ModalHostViewProps() = default;
|
||||
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
|
||||
public bool allowSwipeDismissal;
|
||||
public bool animated;
|
||||
public bool hardwareAccelerated;
|
||||
public bool navigationBarTranslucent;
|
||||
public bool statusBarTranslucent;
|
||||
|
||||
@@ -3347,7 +3347,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
|
||||
public ModalHostViewProps() = default;
|
||||
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
|
||||
public bool allowSwipeDismissal;
|
||||
public bool animated;
|
||||
public bool hardwareAccelerated;
|
||||
public bool navigationBarTranslucent;
|
||||
public bool statusBarTranslucent;
|
||||
|
||||
@@ -5572,7 +5572,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
|
||||
public ModalHostViewProps() = default;
|
||||
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
|
||||
public bool allowSwipeDismissal;
|
||||
public bool animated;
|
||||
public bool hardwareAccelerated;
|
||||
public bool navigationBarTranslucent;
|
||||
public bool statusBarTranslucent;
|
||||
|
||||
@@ -5496,7 +5496,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
|
||||
public ModalHostViewProps() = default;
|
||||
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
|
||||
public bool allowSwipeDismissal;
|
||||
public bool animated;
|
||||
public bool hardwareAccelerated;
|
||||
public bool navigationBarTranslucent;
|
||||
public bool statusBarTranslucent;
|
||||
|
||||
@@ -5569,7 +5569,6 @@ class facebook::react::ModalHostViewProps : public facebook::react::HostPlatform
|
||||
public ModalHostViewProps() = default;
|
||||
public ModalHostViewProps(const facebook::react::PropsParserContext& context, const facebook::react::ModalHostViewProps& sourceProps, const facebook::react::RawProps& rawProps);
|
||||
public bool allowSwipeDismissal;
|
||||
public bool animated;
|
||||
public bool hardwareAccelerated;
|
||||
public bool navigationBarTranslucent;
|
||||
public bool statusBarTranslucent;
|
||||
|
||||
Reference in new issue
Block a user