Repository navigation
[all components] Fix prop and ref merging for lazy render elements - #5562
Merged
Merged
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,578.61 ms +195.38 ms(+14.1%) | Renders: 76 (+0) | Paint: 2,565.41 ms +373.47 ms(+17.0%)
…and 5 more (+5 within noise) — details Metric alarms
…and 9 more metric alarms — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
atomiks
marked this pull request as ready for review
August 25, 2026 10:18
atomiks
requested review from
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
August 25, 2026 10:18
This was referenced Aug 26, 2026
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.
Fixes #5431
Fixes #5561
useRenderElementread the render element's props (mergeProps(props, render.props)) and its ref (getReactElementRef) before the #3856 lazy unwrap. A lazy render element, which is what the Flight client hands a Client Component when a Server Component element gets deferred into its own payload row, has no.propsor.ref. Its props therefore lost the documented precedence (the component's own props silently won) and its ref was never attached. Since Flight defers based on payload size, the server and client passes could disagree, which surfaced as hydration mismatches in Next.js App Router apps.Changes
useRenderElement, before the ref extraction and the prop merge, instead of just beforecloneElement. The unwrap is skipped whenenabled: false, since unwrapping a pending lazy element suspends and the disabled path never suspended before.Children.toArrayonly unwraps lazy elements there (which also means the [all components] Support lazy element inrenderprop #3856 workaround was already React 19-only).