fix: resolve hydration mismatch on /labs and /speaking#38
Merged
Conversation
a72486a to
d391716
Compare
d391716 to
746c7a9
Compare
UPageHero already wraps the #title slot in an <h1>. The pages were adding their own <h1> directly inside that slot, producing invalid nested <h1>. The browser auto-closes the outer h1 when parsing the inner one, so the actual DOM has two sibling h1s while Vue's vDOM expects them nested — that mismatch was the source of the hydration warning on these two pages (the homepage's #title slot wraps its h1 in <div>, so the auto-close rule doesn't trigger there). Pass title via the prop and move the heading classes onto UPageHero's title UI slot instead. Fixes #35
746c7a9 to
8345d6b
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.
$(cat <<'EOF'
Summary
Motioncomponents that use:initial+:while-in-viewin<ClientOnly>across/labs,/speaking, and the landing page components<ClientOnly>provides a#fallbackslot with the same card content rendered without animation, preserving SSR output and SEORoot cause
motion-v's<Motion>with:initial="{ opacity: 0 }"and:while-in-viewapplies those inline styles during SSR. On/labsand/speakingthe animated list items are immediately in the viewport, so the client'sIntersectionObserverfires during hydration and produces different inline styles than SSR rendered — triggering Vue's hydration mismatch warning. The homepage was unaffected because its animated sections sit below the fold on initial load.Files changed
app/pages/labs/index.vueapp/pages/speaking/index.vueapp/components/landing/Focus.vueapp/components/landing/WorkExperience.vueapp/components/landing/LabsTeaser.vueapp/components/landing/SpeakingTeaser.vueTest plan
/labs— no hydration mismatch warning in the console/speaking— no hydration mismatch warning in the console/— no hydration mismatch warning in the consoleCloses #35
https://claude.ai/code/session_01MtWZsfPFM7Pwmpze7ataCW
EOF
)
Generated by Claude Code