[tabs][slider] Skip client-only prehydration scripts#4530
[tabs][slider] Skip client-only prehydration scripts#4530atomiks merged 5 commits intomui:masterfrom
Conversation
commit: |
Bundle size report
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. |
Codex Review (GPT-5.4)This is a 1. Bugs / Issues (None)2. Root Cause & Patch AssessmentThe final shape looks correct to me. The old Using a shared 3. Pattern Consistency AssessmentThe consistency pass across the affected Slider paths was worthwhile. Updating The new helper is also appropriately small and private. Reusing 4. Test Coverage AssessmentThe regression coverage now matches the change well enough for a bug-fix PR of this size. In particular, the branch adds:
I also rechecked the targeted validation that matters for the touched paths:
I additionally verified the PR-published package itself via
That external-package check is especially useful here because it confirms the fix is not just correct in the local workspace build, but also in the actual package artifact reviewers and downstream users would install. RecommendationApprove ✅ I don’t see any remaining correctness issues in the final branch. The patch now fixes the actual hydration-vs-client-mount distinction, applies that reasoning consistently to the affected Slider/Tabs paths, and now has both focused in-repo regression coverage and a fresh Next.js external-package repro confirming the published PR artifact eliminates the warning without masking the underlying Next regression. |
Fixes #4373
This avoids rendering Base UI's pre-hydration inline scripts when a component is mounting client-side instead of hydrating server-rendered markup. The key nuance is that
isMountedis not enough here: on a Next.js client transition the first client render still hasisMounted === false, so the old logic continued to render the script and trigger the warning.useIsHydratingfixes that by distinguishing SSR hydration from a fresh client-only mount.Changes
trueonly during SSR hydration.Tabs.IndicatorandSlideredge-aligned pre-hydration behavior on hydration instead of mount state.