Skip to content

Conversation

@everettbu
Copy link

Mirror of facebook/react#35508
Original author: javache


Summary

This has been fully rolled out internally and was manually merged in the RN release in facebook/react-native@0411c43

How did you test this change?

yarn flow fabric

@greptile-apps
Copy link

greptile-apps bot commented Jan 14, 2026

Greptile Summary

This PR removes the enableEagerAlternateStateNodeCleanup feature flag that has been fully rolled out internally and manually merged in React Native. The flag controlled eager cleanup of alternate state nodes to reclaim memory in React Native's persistence mode. Since the flag was set to true across all environments, the code path is now permanently enabled by removing the conditional check in ReactFiberCommitWork.js and removing the flag definition from all feature flag configuration files.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • This is a straightforward feature flag cleanup that removes a flag that was already enabled everywhere (set to true in all configurations). The logic change in ReactFiberCommitWork.js correctly un-nests the code that was previously guarded by the flag, and all references to the flag have been completely removed from the codebase. The change has already been rolled out internally and manually merged in React Native, confirming it's battle-tested.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react-reconciler/src/ReactFiberCommitWork.js Removed feature flag check and un-nested the alternate state node cleanup logic, making it always execute
packages/shared/ReactFeatureFlags.js Removed enableEagerAlternateStateNodeCleanup flag definition
packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js Removed enableEagerAlternateStateNodeCleanup from dynamic exports
packages/shared/forks/ReactFeatureFlags.native-fb.js Removed enableEagerAlternateStateNodeCleanup from exports
packages/shared/forks/ReactFeatureFlags.native-oss.js Removed enableEagerAlternateStateNodeCleanup flag definition (was set to true)
packages/shared/forks/ReactFeatureFlags.test-renderer.js Removed enableEagerAlternateStateNodeCleanup flag definition (was set to true)
packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js Removed enableEagerAlternateStateNodeCleanup flag definition (was set to true)
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js Removed enableEagerAlternateStateNodeCleanup flag definition (was set to true)
packages/shared/forks/ReactFeatureFlags.www.js Removed enableEagerAlternateStateNodeCleanup flag definition (was set to true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants