Skip to content

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Oct 13, 2025

Closes #34818

Seems to me the event payload handling should've gone into the original fallthrough block instead of just handling it for FunctionComponent: https://github.com/facebook/react/pull/25229/files#diff-9e8ee221dbf99e0ccdad6a63bf63804dea26f1785e2f443dbe92fa835a63b83eL412-L415

See first commit for current behavior where Effect Events did not read the latest Context value if used in React.memo Components.

@meta-cla meta-cla bot added the CLA Signed label Oct 13, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Oct 13, 2025
Comment on lines +865 to +866
logContextValue = fireLogContextValue;
}, []);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The original report registered an interval here. Even after rendering with a new context value, the interval continued to log the initial value.

@react-sizebot
Copy link

Comparing: 1d68bce...6bec011

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.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 605.42 kB 604.97 kB = 107.21 kB 107.14 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 664.39 kB 663.94 kB = 117.09 kB 117.03 kB
facebook-www/ReactDOM-prod.classic.js = 688.26 kB 687.80 kB = 121.13 kB 121.07 kB
facebook-www/ReactDOM-prod.modern.js = 678.69 kB 678.22 kB = 119.48 kB 119.42 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 6bec011

@eps1lon eps1lon changed the title [Fiber] Ensure Effect events read latest values in forwardRef and memo() Components [Fiber] Ensure useEffectEvent reads latest values in forwardRef and memo() Components Oct 13, 2025
@eps1lon eps1lon marked this pull request as ready for review October 13, 2025 08:08
@eps1lon eps1lon merged commit 93d4458 into facebook:main Oct 13, 2025
249 of 250 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
@eps1lon eps1lon deleted the sebbie/uee-memo branch October 13, 2025 16:05
sebmarkbage pushed a commit to vercel/next.js that referenced this pull request Oct 14, 2025
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.

Bug: Stale closures with useEffectEvent

3 participants