From b9294a70fb3cbfea662920affabc835dc30064dc Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Thu, 8 Jan 2026 15:00:26 -0800 Subject: [PATCH] Fling: Cleanup `virtualViewActivityBehavior` (#55096) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55096 Cleans up the `virtualViewActivityBehavior` feature flag, which never shipped. More work is needed if we want to use `Activity` without significantly increasing memory usage and increasing the likelihood of OOMs. Changelog: [Internal] Reviewed By: CalixTang Differential Revision: D90335258 fbshipit-source-id: ccb2b4607bb508eb82c88c50ae267fdbb5f74a6d --- .../ReactNativeFeatureFlags.config.js | 10 ---------- .../components/virtualview/VirtualView.js | 16 ++-------------- .../featureflags/ReactNativeFeatureFlags.js | 8 +------- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 2a5d37ddc90..9bf6c0248bf 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -1063,16 +1063,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - virtualViewActivityBehavior: { - defaultValue: 'no-activity', - metadata: { - dateAdded: '2025-08-27', - description: 'Changes whether and how `VirtualView` uses `Activity`.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, }, }; diff --git a/packages/react-native/src/private/components/virtualview/VirtualView.js b/packages/react-native/src/private/components/virtualview/VirtualView.js index 7f952492cd1..f9436872db8 100644 --- a/packages/react-native/src/private/components/virtualview/VirtualView.js +++ b/packages/react-native/src/private/components/virtualview/VirtualView.js @@ -15,14 +15,12 @@ import type {NativeModeChangeEvent} from './VirtualViewNativeComponent'; import UIManager from '../../../../Libraries/ReactNative/UIManager'; import StyleSheet from '../../../../Libraries/StyleSheet/StyleSheet'; -import * as ReactNativeFeatureFlags from '../../featureflags/ReactNativeFeatureFlags'; import {useVirtualViewLogging} from './logger/VirtualViewLogger'; import VirtualViewExperimentalNativeComponent from './VirtualViewExperimentalNativeComponent'; import VirtualViewProperNativeComponent from './VirtualViewNativeComponent'; import nullthrows from 'nullthrows'; import * as React from 'react'; -// $FlowFixMe[missing-export] -import {startTransition, unstable_Activity as Activity, useState} from 'react'; +import {startTransition, useState} from 'react'; // @see VirtualViewNativeComponent export enum VirtualViewMode { @@ -155,17 +153,7 @@ function createVirtualView(initialState: State): VirtualViewComponent { : style } onModeChange={handleModeChange}> - { - match (ReactNativeFeatureFlags.virtualViewActivityBehavior()) { - 'activity-without-mode' => - {isHidden ? null : children}, - 'activity-with-hidden-mode' => - - {children} - , - 'no-activity' | _ => isHidden ? null : children, - } - } + {isHidden ? null : children} ); } diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index fb16bd1c38f..ad4ae4196a0 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -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<<480e58e52425586928349b9f3560ce7f>> + * @generated SignedSource<> * @flow strict * @noformat */ @@ -41,7 +41,6 @@ export type ReactNativeFeatureFlagsJsOnly = $ReadOnly<{ shouldUseLinkRoleForPressableText: Getter, shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter, shouldUseSetNativePropsInFabric: Getter, - virtualViewActivityBehavior: Getter, }>; export type ReactNativeFeatureFlagsJsOnlyOverrides = OverridesFor; @@ -199,11 +198,6 @@ export const shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter = cre */ export const shouldUseSetNativePropsInFabric: Getter = createJavaScriptFlagGetter('shouldUseSetNativePropsInFabric', true); -/** - * Changes whether and how `VirtualView` uses `Activity`. - */ -export const virtualViewActivityBehavior: Getter = createJavaScriptFlagGetter('virtualViewActivityBehavior', "no-activity"); - /** * Common flag for testing. Do NOT modify. */