Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Fiber] Run Fragment deletion effects for HostText children - #37168

Merged
jackpope merged 1 commit into
mainfrom
fragment-refs/text-child-deletion-effects
Aug 13, 2026
Merged

[Fiber] Run Fragment deletion effects for HostText children#37168
jackpope merged 1 commit into
mainfrom
fragment-refs/text-child-deletion-effects

Conversation

@jackpope

@jackpope jackpope commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

There was inconsistent behavior with text nodes retaining event listeners while all other nodes have them removed in deletion effects. This fixes that handling

@meta-cla meta-cla Bot added the CLA Signed label Jul 31, 2026
@jackpope
jackpope force-pushed the fragment-refs/text-child-deletion-effects branch from 9c03633 to 2d5a72c Compare July 31, 2026 19:15
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Jul 31, 2026
@jackpope
jackpope force-pushed the fragment-refs/text-child-deletion-effects branch from 2d5a72c to c1d3ba3 Compare July 31, 2026 20:15
@jackpope
jackpope force-pushed the fragment-refs/text-child-deletion-effects branch from c1d3ba3 to ee3e694 Compare July 31, 2026 20:55
@jackpope
jackpope requested a review from eps1lon July 31, 2026 21:09
@jackpope
jackpope marked this pull request as ready for review July 31, 2026 21:09
if (enableFragmentRefs && enableFragmentRefsTextNodes) {
commitFragmentInstanceInsertionEffects(finishedWork);
}
break;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it intentional that we no longer run recursivelyTraverseReappearLayoutEffects for HostText? I guess this doesn't change any behavior right now but just want to make sure we're not breaking some implicit assumptions.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HostText is always a leaf so it should be fine to handle this directly against the node for disappear/reappear

@jackpope
jackpope force-pushed the fragment-refs/text-child-deletion-effects branch from ee3e694 to 4240abd Compare August 9, 2026 19:15
@jackpope
jackpope force-pushed the fragment-refs/text-child-deletion-effects branch from 4240abd to 25d3ba2 Compare August 11, 2026 03:49

@poteto poteto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (light skim). Stacking stamps for the fragment-refs land sequence.

Base automatically changed from fragment-refs/extract-fragment-instance to main August 12, 2026 01:46
HostText entered deletion and disappear/reappear switches past the
HostComponent cases that called fragment instance bookkeeping, so text
children kept listeners after delete and while Activity-hidden. Handle
HostText explicitly in those paths.
@jackpope
jackpope force-pushed the fragment-refs/text-child-deletion-effects branch from 25d3ba2 to 1448cff Compare August 12, 2026 01:57
@react-sizebot

Copy link
Copy Markdown

Comparing: 22e4f99...1448cff

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 7.35 kB 7.35 kB = 1.96 kB 1.96 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.02% 620.64 kB 620.78 kB = 109.73 kB 109.71 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 7.36 kB 7.36 kB = 1.96 kB 1.96 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.02% 691.85 kB 691.99 kB = 121.23 kB 121.21 kB
facebook-www/ReactDOM-prod.classic.js +0.04% 712.09 kB 712.34 kB = 124.72 kB 124.70 kB
facebook-www/ReactDOM-prod.modern.js +0.04% 702.40 kB 702.65 kB = 123.14 kB 123.12 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 1448cff

@jackpope
jackpope merged commit 9880384 into main Aug 13, 2026
238 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 13, 2026
There was inconsistent behavior with text nodes retaining event
listeners while all other nodes have them removed in deletion effects.
This fixes that handling

DiffTrain build for [9880384](9880384)
github-actions Bot pushed a commit that referenced this pull request Aug 13, 2026
There was inconsistent behavior with text nodes retaining event
listeners while all other nodes have them removed in deletion effects.
This fixes that handling

DiffTrain build for [9880384](9880384)
github-actions Bot pushed a commit to code/lib-react that referenced this pull request Aug 13, 2026
)

There was inconsistent behavior with text nodes retaining event
listeners while all other nodes have them removed in deletion effects.
This fixes that handling

DiffTrain build for [9880384](react@9880384)
github-actions Bot pushed a commit to code/lib-react that referenced this pull request Aug 13, 2026
)

There was inconsistent behavior with text nodes retaining event
listeners while all other nodes have them removed in deletion effects.
This fixes that handling

DiffTrain build for [9880384](react@9880384)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants