From ecad90ad8b68c623d028938cf84d1dbccc45e45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Thu, 6 Feb 2025 04:12:56 -0800 Subject: [PATCH] fix: move view flattening props to cross platform type interface (#49220) Summary: Hey! Since new architecture introduced View Flattening on iOS, props responsible for disabling this feature on specific views should be defined in cross platform interface. Reference: https://github.com/reactwg/react-native-new-architecture/discussions/110 ## Changelog: [GENERAL] [CHANGED] - move view flattening props to cross platform type interface Pull Request resolved: https://github.com/facebook/react-native/pull/49220 Test Plan: N/A Reviewed By: fabriziocucci Differential Revision: D69239454 Pulled By: javache fbshipit-source-id: a89cb9fbaec63bbcb7691df067d5d3a375a8a66e --- .../Components/View/ViewPropTypes.d.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts index a1aa196ccbd..eb44b3adea2 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts @@ -76,20 +76,6 @@ export interface ViewPropsIOS extends TVViewPropsIOS { } export interface ViewPropsAndroid { - /** - * Views that are only used to layout their children or otherwise don't draw anything - * may be automatically removed from the native hierarchy as an optimization. - * Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy. - */ - collapsable?: boolean | undefined; - - /** - * Setting to false prevents direct children of the view from being removed - * from the native view hierarchy, similar to the effect of setting - * `collapsable={false}` on each child. - */ - collapsableChildren?: boolean | undefined; - /** * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. * @@ -211,4 +197,18 @@ export interface ViewProps * Used to reference react managed views from native code. */ nativeID?: string | undefined; + + /** + * Views that are only used to layout their children or otherwise don't draw anything + * may be automatically removed from the native hierarchy as an optimization. + * Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy. + */ + collapsable?: boolean | undefined; + + /** + * Setting to false prevents direct children of the view from being removed + * from the native view hierarchy, similar to the effect of setting + * `collapsable={false}` on each child. + */ + collapsableChildren?: boolean | undefined; }