diff --git a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js index a2b98882a79..926fa7360f1 100644 --- a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +++ b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js @@ -35,8 +35,12 @@ const DRAWER_STATES = ['Idle', 'Dragging', 'Settling'] as const; /** * React component that wraps the platform `DrawerLayout` (Android only). The Drawer (typically used for navigation) is rendered with `renderNavigationView` and direct children are the main view. The navigation view is initially not visible on the screen, but can be pulled in from the side of the window specified by the `drawerPosition` prop and its width can be set by the `drawerWidth` prop. * - * @see https://reactnative.dev/docs/drawerlayoutandroid + * DrawerLayoutAndroid is deprecated and will be removed in a future release. + * Use `react-native-drawer-layout` instead. + * + * @see https://reactnavigation.org/docs/drawer-layout/ * @platform android + * @deprecated */ class DrawerLayoutAndroid extends React.Component diff --git a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts index 2f2e08efc1e..26fdec88e43 100644 --- a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +++ b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts @@ -21,7 +21,10 @@ export interface DrawerSlideEvent extends NativeSyntheticEvent {} /** - * @see DrawerLayoutAndroid.android.js + * DrawerLayoutAndroid is deprecated and will be removed in a future release. + * Use `react-native-drawer-layout` instead. + * @see https://reactnavigation.org/docs/drawer-layout/ + * @deprecated */ export interface DrawerLayoutAndroidProps extends ViewProps { /** @@ -123,6 +126,12 @@ interface DrawerPosition { declare class DrawerLayoutAndroidComponent extends React.Component {} declare const DrawerLayoutAndroidBase: Constructor & typeof DrawerLayoutAndroidComponent; +/** + * DrawerLayoutAndroid is deprecated and will be removed in a future release. + * Use `react-native-drawer-layout` instead. + * @see https://reactnavigation.org/docs/drawer-layout/ + * @deprecated + */ export class DrawerLayoutAndroid extends DrawerLayoutAndroidBase { /** * drawer's positions. diff --git a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js index d7f7df9c800..c5b16a13e09 100644 --- a/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +++ b/packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js @@ -27,6 +27,12 @@ export type DrawerSlideEvent = NativeSyntheticEvent< }>, >; +/** + * DrawerLayoutAndroid is deprecated and will be removed in a future release. + * Use `react-native-drawer-layout` instead. + * @see https://reactnavigation.org/docs/drawer-layout/ + * @deprecated + */ export type DrawerLayoutAndroidProps = Readonly<{ ...ViewProps, diff --git a/packages/react-native/index.js b/packages/react-native/index.js index 69c3f67ca8b..533c97f038f 100644 --- a/packages/react-native/index.js +++ b/packages/react-native/index.js @@ -38,7 +38,18 @@ module.exports = { get Button() { return require('./Libraries/Components/Button').default; }, + /** + * @deprecated DrawerLayoutAndroid is deprecated and will be removed in a future release. + * Use 'react-native-drawer-layout' instead. + * See https://reactnavigation.org/docs/drawer-layout/ + */ get DrawerLayoutAndroid() { + warnOnce( + 'drawer-layout-android-deprecated', + 'DrawerLayoutAndroid is deprecated and will be removed in a future release. ' + + "Use 'react-native-drawer-layout' instead. " + + 'See https://reactnavigation.org/docs/drawer-layout/', + ); return require('./Libraries/Components/DrawerAndroid/DrawerLayoutAndroid') .default; },