Skip to content

Commit

Permalink
Revert "Temporary hotfix for broken view flattening on Android" (face…
Browse files Browse the repository at this point in the history
…book#40885)

Summary:

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
  • Loading branch information
rozele authored and facebook-github-bot committed Oct 13, 2023
1 parent c9d6612 commit 3f11003
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
11 changes: 0 additions & 11 deletions packages/react-native/Libraries/Components/View/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

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

import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags';
import flattenStyle from '../../StyleSheet/flattenStyle';
import TextAncestor from '../../Text/TextAncestor';
import ViewNativeComponent from './ViewNativeComponent';
Expand Down Expand Up @@ -102,20 +101,10 @@ const View: React.AbstractComponent<

// $FlowFixMe[sketchy-null-mixed]
const newPointerEvents = style?.pointerEvents || pointerEvents;
const collapsableOverride =
ReactNativeFeatureFlags.shouldForceUnflattenForElevation()
? {
collapsable:
style != null && style.elevation != null && style.elevation !== 0
? false
: otherProps.collapsable,
}
: {};

const actualView = (
<ViewNativeComponent
{...otherProps}
{...collapsableOverride}
accessibilityLiveRegion={
ariaLive === 'off' ? 'none' : ariaLive ?? accessibilityLiveRegion
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ export type FeatureFlags = {|
* Enables use of setNativeProps in JS driven animations.
*/
shouldUseSetNativePropsInFabric: () => boolean,
/**
* Enables a hotfix for forcing materialization of views with elevation set.
*/
shouldForceUnflattenForElevation: () => boolean,
|};

const ReactNativeFeatureFlags: FeatureFlags = {
Expand All @@ -70,7 +66,6 @@ const ReactNativeFeatureFlags: FeatureFlags = {
enableAccessToHostTreeInFabric: () => false,
shouldUseAnimatedObjectForTransform: () => false,
shouldUseSetNativePropsInFabric: () => false,
shouldForceUnflattenForElevation: () => false,
};

module.exports = ReactNativeFeatureFlags;

0 comments on commit 3f11003

Please sign in to comment.