[flags] Cleanup enableFragmentRefs feature flag #37573

Merged
javache opened 10:15am on September 10, 2026 wanted to merge 374 Ξ” into facebook/react main from
cleanup/enable-fragment-refs
Reviewing
153 fewer changed lines
(44% less) vs GitHub
This saves about 77.0 hours per year vs conventional diff tools
javache authored
of work during September 10
Diff Delta:
374
About 92 Diff Delta/hour
Classified as:  Bug Fix, General

javache's Description of Work

Summary

enableFragmentRefs is enabled in every channel, so this inlines the enabled branch and removes the flag from ReactFeatureFlags and all of its forks.

Most of the diff is mechanical, but a few spots needed care:


  • Several case Fragment: blocks in ReactFiberCommitWork had a // Fallthrough that was only reachable with the flag off. Where a preceding case falls into Fragment (the ViewTransitionComponent cases), I verified the resulting behavior is unchanged for every remaining flag combination.


  • commitAttachRef in ReactFiberCommitEffects becomes a plain case Fragment: { ... break; } instead of a conditional fallthrough into default.

  • The React.Fragment invalid-prop warning no longer has two variants; it always mentions key, ref, and children.

The three related flags β€” enableFragmentRefsScrollIntoView, enableFragmentRefsInstanceHandles, and enableFragmentRefsTextNodes β€” are not on everywhere yet and are left in place.

In tests, enableFragmentRefs was stripped from 101 @gate pragmas. Combined gates such as @gate enableFragmentRefs && enableFragmentRefsTextNodes were reduced rather than removed. One test asserted the absence of a warning under the flag, so it was renamed from warns for fragments with refs to does not warn for fragments with refs.

How did you test this change?

yarn lint, yarn prettier-check, and yarn flow for dom-node, dom-browser, and fabric all pass.

Full test suite run across experimental, stable, www-modern, www-classic, and xplat, with both --variant settings, plus --persistent. The remaining failures (Fizz / Flight / FrameScheduling / ClassEquivalence) are pre-existing: I diffed the individual failing test names against the base commit and they are identical.

Building updated commit group diff...
19 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...