fix: stabilize merged refs across core - #5267
Open
nynexman4464 wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
nynexman4464
force-pushed
the
fix/migrate-inline-merge-refs
branch
from
August 20, 2026 22:44
fcff8cd to
f9669ec
Compare
nynexman4464
force-pushed
the
fix/migrate-inline-merge-refs
branch
from
August 20, 2026 22:50
f9669ec to
d3b2def
Compare
nynexman4464
marked this pull request as ready for review
August 20, 2026 23:18
nynexman4464
force-pushed
the
fix/migrate-inline-merge-refs
branch
from
August 20, 2026 23:21
d3b2def to
c9cbbfd
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsAppShell (@astryxdesign/core) · View in Storybook
AvatarGroup (@astryxdesign/core) · View in Storybook
BottomSheet (@astryxdesign/core) · View in Storybook
Breadcrumbs (@astryxdesign/core) · View in Storybook
ButtonGroup (@astryxdesign/core) · View in Storybook
Carousel (@astryxdesign/core) · View in Storybook
Chat (@astryxdesign/core) · View in Storybook
CheckboxInput (@astryxdesign/core) · View in Storybook
ClickableCard (@astryxdesign/core) · View in Storybook
CommandPalette (@astryxdesign/core) · View in Storybook
ContextMenu (@astryxdesign/core) · View in Storybook
DateInput (@astryxdesign/core) · View in Storybook
DateTimeInput (@astryxdesign/core) · View in Storybook
Dialog (@astryxdesign/core) · View in Storybook
FileInput (@astryxdesign/core) · View in Storybook
Heading (@astryxdesign/core) · View in Storybook
Item (@astryxdesign/core) · View in Storybook
Lightbox (@astryxdesign/core) · View in Storybook
MobileNav (@astryxdesign/core) · View in Storybook
NavMenu (@astryxdesign/core) · View in Storybook
Outline (@astryxdesign/core) · View in Storybook
OverflowList (@astryxdesign/core) · View in Storybook
Overlay (@astryxdesign/core) · View in Storybook
PowerSearch (@astryxdesign/core) · View in Storybook
Resizable (@astryxdesign/core) · View in Storybook
SegmentedControl (@astryxdesign/core) · View in Storybook
SelectableCard (@astryxdesign/core) · View in Storybook
SideNav (@astryxdesign/core) · View in Storybook
Slider (@astryxdesign/core) · View in Storybook
Switch (@astryxdesign/core) · View in Storybook
TabList (@astryxdesign/core) · View in Storybook
Text (@astryxdesign/core) · View in Storybook
TextArea (@astryxdesign/core) · View in Storybook
TextInput (@astryxdesign/core) · View in Storybook
TimeInput (@astryxdesign/core) · View in Storybook
Timestamp (@astryxdesign/core) · View in Storybook
Token (@astryxdesign/core) · View in Storybook
TopNav (@astryxdesign/core) · View in Storybook
Typeahead (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 12 accessibility violation(s) found — 11 serious, 1 moderate. Chat - 1 issue(s)
ClickableCard - 1 issue(s)
FileInput - 1 issue(s)
Heading - 1 issue(s)
Outline - 1 issue(s)
OverflowList - 1 issue(s)
PowerSearch - 1 issue(s)
SelectableCard - 1 issue(s)
TabList - 1 issue(s)
Text - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
imdreamrunner
approved these changes
Aug 21, 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.
Stack
This is 2 of 3 in GitHub stack #5270:
useMergedRefsand fixText/HeadingReview and land in this order. This PR is based directly on #5266.
Why this migration is needed
#5266 fixes the production failure in
TextandHeadingand introducesuseMergedRefs, but the same unsafe construction appears elsewhere in core:mergeRefs(...)returns a callback. Calling it during render creates a new callback identity every time, so React detaches the previous ref and attaches the new one even when the DOM element did not change.The impact varies by component:
null → elementwritesWhat this PR changes
Migrates every remaining direct JSX use in core from:
to:
The migration covers 43 callsites across 40 core files.
Most hook calls remain directly in unconditional JSX, which is valid under the Rules of Hooks. Calls that were inside conditional branches or after early returns were hoisted to top-level declarations. Both
@eslint-react/rules-of-hooksand React Compiler lint pass over every migrated file.No component API, DOM structure, styling, or intended ref target changes. Only callback identity changes: the merged ref now changes when one of its input refs changes, rather than on every render.
Scope
This PR intentionally covers core only. Lab is outside this migration's requested scope. The enforcement PR is likewise limited to core.
Validation
pnpm -F @astryxdesign/core buildpnpm lintmergeRefsimportsmergeRefs(...)callsites in core