Skip to content

fix: avoid hydration mismatch warning for styles with different order - #10011

Merged
yyx990803 merged 9 commits into
vuejs:mainfrom
zh-lx:fix-hydration-mismatch-styles-order
Jan 8, 2024
Merged

yyx990803 merged 9 commits into
vuejs:mainfrom
zh-lx:fix-hydration-mismatch-styles-order

Conversation

@zh-lx

@zh-lx zh-lx commented Jan 5, 2024 •

Copy link
Copy Markdown
Contributor

close #10006, close #10000

  1. avoid hydration mismatch warning for styles with different order
  2. when element with props vShow or v-show, show add display: none when compare match
  3. Some attributes of element can't be gotten by el.hasAttribute(key) such as value of textarea. So we should add checks by el[key] to validate.

@github-actions

github-actions Bot commented Jan 5, 2024

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 89.4 kB 34 kB 30.7 kB
vue.global.prod.js 146 kB 53.3 kB 47.6 kB

Usages

Name Size Gzip Brotli
createApp 49.7 kB 19.5 kB 17.8 kB
createSSRApp 53.1 kB 20.8 kB 19 kB
defineCustomElement 52 kB 20.2 kB 18.5 kB
overall 63.2 kB 24.4 kB 22.2 kB

@yyx990803

Copy link
Copy Markdown
Member

A note on e2ac3b5 - getSSRProps is only initialized on the directives during server render, and is not available in the client build, so we can't rely on that to handle SSR injected props.

For now, we'll just special-case v-show since that is the only built-in directive that affects style hydration.

@wangjingyu001

wangjingyu001 commented Oct 14, 2026 •

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hydration mismatch when using v-show and custom style attribute SSR Hydration mismatch with HeadlessUI starting in 3.4.x

3 participants