Skip to content

Commit 3a26e55

Browse files
rozelefacebook-github-bot
authored andcommitted
Revert "Temporary hotfix for broken view flattening on Android" (facebook#40885)
Summary: Pull Request resolved: facebook#40885 We no longer need this hotfix since the native fix has been stable for some time now. Cleans up the feature flags and forced `collapsable={false}` prop in View. ## Changelog [General][Internal] Reviewed By: yungsters, NickGerleman Differential Revision: D50241092 fbshipit-source-id: 57a3121356736bd6633e3672e6a8369067e45811
1 parent c9d6612 commit 3a26e55

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

packages/react-native/Libraries/Components/View/View.js

-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import type {ViewProps} from './ViewPropTypes';
1212

13-
import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags';
1413
import flattenStyle from '../../StyleSheet/flattenStyle';
1514
import TextAncestor from '../../Text/TextAncestor';
1615
import ViewNativeComponent from './ViewNativeComponent';
@@ -102,20 +101,10 @@ const View: React.AbstractComponent<
102101

103102
// $FlowFixMe[sketchy-null-mixed]
104103
const newPointerEvents = style?.pointerEvents || pointerEvents;
105-
const collapsableOverride =
106-
ReactNativeFeatureFlags.shouldForceUnflattenForElevation()
107-
? {
108-
collapsable:
109-
style != null && style.elevation != null && style.elevation !== 0
110-
? false
111-
: otherProps.collapsable,
112-
}
113-
: {};
114104

115105
const actualView = (
116106
<ViewNativeComponent
117107
{...otherProps}
118-
{...collapsableOverride}
119108
accessibilityLiveRegion={
120109
ariaLive === 'off' ? 'none' : ariaLive ?? accessibilityLiveRegion
121110
}

packages/react-native/Libraries/ReactNative/ReactNativeFeatureFlags.js

-5
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ export type FeatureFlags = {|
5454
* Enables use of setNativeProps in JS driven animations.
5555
*/
5656
shouldUseSetNativePropsInFabric: () => boolean,
57-
/**
58-
* Enables a hotfix for forcing materialization of views with elevation set.
59-
*/
60-
shouldForceUnflattenForElevation: () => boolean,
6157
|};
6258

6359
const ReactNativeFeatureFlags: FeatureFlags = {
@@ -70,7 +66,6 @@ const ReactNativeFeatureFlags: FeatureFlags = {
7066
enableAccessToHostTreeInFabric: () => false,
7167
shouldUseAnimatedObjectForTransform: () => false,
7268
shouldUseSetNativePropsInFabric: () => false,
73-
shouldForceUnflattenForElevation: () => false,
7469
};
7570

7671
module.exports = ReactNativeFeatureFlags;

0 commit comments

Comments
 (0)