From 91cedb8b921b08dc3f9a9b2889d34cbf9539b06c Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 1 Jun 2026 08:57:18 -0700 Subject: [PATCH] Remove legacy NativeMethods types Summary: Long deprecated, drop from our public API. Relates to https://github.com/react-native-community/discussions-and-proposals/pull/1003. Changelog: [General][Breaking] - Remove `NativeMethods` and `NativeMethodsMixin` types. Use `ReactNativeElement` instead. Differential Revision: D107108484 --- packages/eslint-plugin-react-native/utils.js | 2 -- .../ReactPrivate/ReactNativePrivateInterface.js | 1 - .../ReactPrivate/ReactNativePrivateInterface.js.flow | 1 - packages/react-native/index.js.flow | 2 -- packages/react-native/src/private/types/HostInstance.js | 8 -------- packages/react-native/types/public/ReactNativeTypes.d.ts | 9 --------- 6 files changed, 23 deletions(-) diff --git a/packages/eslint-plugin-react-native/utils.js b/packages/eslint-plugin-react-native/utils.js index 3c9650e06e5..6978d83aadb 100644 --- a/packages/eslint-plugin-react-native/utils.js +++ b/packages/eslint-plugin-react-native/utils.js @@ -505,8 +505,6 @@ const publicAPIMapping = { default: null, types: [ 'HostInstance', - 'NativeMethods', - 'NativeMethodsMixin', 'MeasureInWindowOnSuccessCallback', 'MeasureLayoutOnSuccessCallback', 'MeasureOnSuccessCallback', diff --git a/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js b/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js index 2d8c0e42d67..7f90727684e 100644 --- a/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js +++ b/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js @@ -41,7 +41,6 @@ import typeof Platform from '../Utilities/Platform'; export type { HostInstance as PublicInstance, // These types are only necessary for Paper - NativeMethods as LegacyPublicInstance, MeasureOnSuccessCallback, MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, diff --git a/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow b/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow index 501df15989b..d4f5291f243 100644 --- a/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +++ b/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow @@ -14,7 +14,6 @@ export type { HostInstance as PublicInstance, // These types are only necessary for Paper - NativeMethods as LegacyPublicInstance, MeasureOnSuccessCallback, MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, diff --git a/packages/react-native/index.js.flow b/packages/react-native/index.js.flow index 9f2eac497d6..99b6e5e0944 100644 --- a/packages/react-native/index.js.flow +++ b/packages/react-native/index.js.flow @@ -455,8 +455,6 @@ export type * from './Libraries/Types/CodegenTypesNamespace'; export type { HostInstance, - NativeMethods, - NativeMethodsMixin, MeasureInWindowOnSuccessCallback, MeasureLayoutOnSuccessCallback, MeasureOnSuccessCallback, diff --git a/packages/react-native/src/private/types/HostInstance.js b/packages/react-native/src/private/types/HostInstance.js index cb7dff7dcc4..055c29ffe64 100644 --- a/packages/react-native/src/private/types/HostInstance.js +++ b/packages/react-native/src/private/types/HostInstance.js @@ -109,11 +109,3 @@ export interface LegacyHostInstanceMethods { } export type HostInstance = ReactNativeElement; - -/** @deprecated Use HostInstance instead */ -export type NativeMethods = LegacyHostInstanceMethods; - -/** - * @deprecated Use HostInstance instead. - */ -export type NativeMethodsMixin = LegacyHostInstanceMethods; diff --git a/packages/react-native/types/public/ReactNativeTypes.d.ts b/packages/react-native/types/public/ReactNativeTypes.d.ts index 3feb5b2d718..4a4c00eb983 100644 --- a/packages/react-native/types/public/ReactNativeTypes.d.ts +++ b/packages/react-native/types/public/ReactNativeTypes.d.ts @@ -111,15 +111,6 @@ export interface NativeMethods { blur(): void; } -/** - * @deprecated Use NativeMethods instead. - */ -export type NativeMethodsMixin = NativeMethods; -/** - * @deprecated Use NativeMethods instead. - */ -export type NativeMethodsMixinType = NativeMethods; - /** * Represents a native component, such as those returned from `requireNativeComponent`. *