Backport React 19 callback ref cleanup functions - #30
Draft
christopher-buss wants to merge 8 commits into
Draft
Conversation
Port the React 19 element and reconciler changes while preserving legacy forwardRef and class component compatibility. Include direct Luau ports of the upstream test coverage with each platform deviation stated alongside the code. Co-authored-by: Codex <noreply@openai.com>
Backport React 19 callback ref cleanups for host, class, and imperative handle refs. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Restore the original detach warning and document the remaining profiler and type adaptations. Refresh callback-ref source links against their pinned upstream revisions. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
christopher-buss
force-pushed
the
backport-react-19-ref-cleanup
branch
2 times, most recently
from
September 6, 2026 17:20
f47c0c8 to
7cc8646
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backports React 19 callback-ref cleanup functions to React-Luau. A callback ref may return a cleanup function; React calls that cleanup instead of calling the ref with nil during detachment. The same lifecycle applies to callback refs passed to useImperativeHandle.
Depends on #26 because this branch is stacked on the ref-as-prop backport.
Upstream pins
Source and test ledger
One additional public class-component callback-ref parity test covers the other ref-bearing public fiber shape supported here.
Semantics and deviations
Verification
7cc8646a88ba931cc4623c8e85328cfefa53bfec653f81154b7ff72dd4a62103f500bedec837b069ReactRefCleanup.spec1 file, 9/9 tests passed, 0 failed, 0 skippedHardened harness record:
run-pr30-fd543976-hardened-final.F8C9AF60A04C1713708C1F97830C578904E1B5B70FCA034269FF66DB6E5CC393EE9B01BA0FA76A94D8EDD2F380AA4C80393A2DA4FFE7C43A23A26B088F96B158DE3963AE41E1ACE7CE186070BB2C9012F2DF5072D31357BF61239C06D26D5806E427DD85C11491B07D5395F56C1B9ABD6E17D5C0CFD94157EAA94107243A5916A44BDE708B753EDF73A3F6D15DDB2A589FEC7D8CF46B94EB75289ACB8602818BGenerated with Codex.