From 1ebf9f7ccb6767b94b56b8d0ab999553408c23d2 Mon Sep 17 00:00:00 2001 From: Maciej Jastrzebski Date: Tue, 15 Jul 2025 22:09:50 +0200 Subject: [PATCH 1/3] fix: restore View display name --- .../Libraries/Components/View/View.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/react-native/Libraries/Components/View/View.js b/packages/react-native/Libraries/Components/View/View.js index a7177fccf159..33ca96118af4 100644 --- a/packages/react-native/Libraries/Components/View/View.js +++ b/packages/react-native/Libraries/Components/View/View.js @@ -23,10 +23,16 @@ import {use} from 'react'; * * @see https://reactnative.dev/docs/view */ -export default component View( +const ViewImpl: component( ref?: React.RefSetter>, ...props: ViewProps -) { +) = ({ + ref, + ...props +}: { + ref?: React.RefSetter>, + ...ViewProps, +}) => { const hasTextAncestor = use(TextAncestorContext); let actualView; @@ -212,4 +218,7 @@ export default component View( ); } return actualView; -} +}; + +ViewImpl.displayName = 'View'; +export default ViewImpl; From 7d40e1cace078fa7d6b990febb2efe599c9397f8 Mon Sep 17 00:00:00 2001 From: Maciej Jastrzebski Date: Tue, 15 Jul 2025 22:34:46 +0200 Subject: [PATCH 2/3] . --- packages/react-native/Libraries/Components/View/View.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/Libraries/Components/View/View.js b/packages/react-native/Libraries/Components/View/View.js index 33ca96118af4..0adb3558103c 100644 --- a/packages/react-native/Libraries/Components/View/View.js +++ b/packages/react-native/Libraries/Components/View/View.js @@ -23,7 +23,7 @@ import {use} from 'react'; * * @see https://reactnative.dev/docs/view */ -const ViewImpl: component( +const View: component( ref?: React.RefSetter>, ...props: ViewProps ) = ({ @@ -220,5 +220,5 @@ const ViewImpl: component( return actualView; }; -ViewImpl.displayName = 'View'; -export default ViewImpl; +View.displayName = 'View'; +export default View; From cd7ab701797214ed4c3e9c28fac1b54191c9cfe4 Mon Sep 17 00:00:00 2001 From: Maciej Jastrzebski Date: Tue, 15 Jul 2025 22:46:54 +0200 Subject: [PATCH 3/3] regen types --- packages/react-native/ReactNativeApi.d.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index eee18b46fb73..9a60b9a16c80 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -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<> + * @generated SignedSource<> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -558,6 +558,12 @@ declare const Vibration_default: { cancel: () => void vibrate: (pattern?: Array | number, repeat?: boolean) => void } +declare const View: typeof View_default +declare const View_default: ( + props: ViewProps & { + ref?: React.Ref> + }, +) => React.ReactNode declare const ViewNativeComponent_default: HostComponent declare const VirtualizedList: typeof VirtualizedListComponent_default declare const VirtualizedListComponent_default: VirtualizedListType @@ -5621,11 +5627,7 @@ declare type ValueXYListenerCallback = (value: { y: number }) => unknown declare type Vibration = typeof Vibration -declare function View( - props: ViewProps & { - ref?: React.Ref> - }, -): React.ReactNode +declare type View = typeof View declare type ViewabilityConfig = { readonly itemVisiblePercentThreshold?: number readonly minimumViewTime?: number @@ -6165,7 +6167,7 @@ export { UIManager, // 8d2c8281 UTFSequence, // baacd11b Vibration, // 315e131d - View, // 75d9e33b + View, // 39dd4de4 ViewProps, // 0ab8ceda ViewPropsAndroid, // f3d007c3 ViewPropsIOS, // 58ee19bf