Skip to content

Conversation

@rickhanlonii
Copy link
Member

@rickhanlonii rickhanlonii commented Jan 17, 2026

Small optimization for useEffectEvent. Not sure we even need a flag for it, but it will be a nice killswitch.

As an added benefit, it fixes a bug when enableViewTransition is on, where we were not updating the useEffectEvent callback when a tree went from hidden to visible.

@meta-cla meta-cla bot added the CLA Signed label Jan 17, 2026
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jan 17, 2026
@react-sizebot
Copy link

react-sizebot commented Jan 17, 2026

Comparing: be3fb29...bac3205

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 = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 608.48 kB 608.48 kB = 107.60 kB 107.60 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB +0.05% 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 670.95 kB 670.95 kB = 118.02 kB 118.02 kB
facebook-www/ReactDOM-prod.classic.js +0.07% 693.87 kB 694.39 kB +0.12% 121.97 kB 122.12 kB
facebook-www/ReactDOM-prod.modern.js +0.08% 684.25 kB 684.77 kB +0.12% 120.37 kB 120.51 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against bac3205

...(gate('enableViewTransition') &&
!gate('enableEffectEventMutationPhase')
? ['Child Layout Create A 3 2 B 1 1 1']
: ['Child Layout Create A 3 2 B 3 2 2']),
Copy link
Member Author

Choose a reason for hiding this comment

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

@sebmarkbage can you review these tests and let me know if you think the first or second logs are right? Inside enableViewTransition, when a tree goes from hidden to visible we were not updating the useEffectEvent callback ref.

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.

2 participants