Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ref cleanup function for imperative handle refs #28910

Merged
merged 1 commit into from Apr 25, 2024

Conversation

kassens
Copy link
Member

@kassens kassens commented Apr 25, 2024

Support ref cleanup function for imperative handle refs

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 25, 2024
@react-sizebot
Copy link

react-sizebot commented Apr 25, 2024

Comparing: cf5ab8b...964ca88

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.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
facebook-www/ReactDOM-prod.classic.js = 591.14 kB 591.19 kB +0.03% 103.91 kB 103.94 kB
facebook-www/ReactDOM-prod.modern.js = 567.36 kB 567.41 kB +0.03% 100.30 kB 100.33 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Generated by 🚫 dangerJS against 964ca88

@noahlemen
Copy link
Member

should these double-invoke in StrictMode too then? would it be worth adding a test for an imperative ref in the StrictMode tests? https://github.com/facebook/react/blob/main/packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js#L411

maybe "DOM refs" isn't the best terminology for me to use in reactjs/react.dev#6777 – it doesn't seem like that encompasses imperative handle refs clearly

@kassens kassens merged commit ed71a3a into facebook:main Apr 25, 2024
38 checks passed
@kassens kassens deleted the pr28910 branch April 25, 2024 16:51
github-actions bot pushed a commit that referenced this pull request Apr 25, 2024
Support ref cleanup function for imperative handle refs

DiffTrain build for [ed71a3a](ed71a3a)
github-actions bot pushed a commit that referenced this pull request Apr 25, 2024
Support ref cleanup function for imperative handle refs

DiffTrain build for commit ed71a3a.
@eps1lon
Copy link
Collaborator

eps1lon commented Apr 25, 2024

@noahlemen Additional StrictMode test would be nice. It "just" works already: https://codesandbox.io/p/sandbox/ref-cleanups-forked-ccp74m?file=%2Fsrc%2Findex.js%3A35%2C46

bigfootjon pushed a commit that referenced this pull request Apr 25, 2024
Support ref cleanup function for imperative handle refs

DiffTrain build for commit ed71a3a.
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.

None yet

6 participants