Looking for clarity on data-allow-mismatch
#13398
Replies: 1 comment
|
For a date/time rendered as text, For a minimal hydration example (with <script setup>
import { ref } from 'vue'
const formattedDate = ref('client time')
</script>
<template>
<time data-allow-mismatch="text">{{ formattedDate }}</time>
</template>I checked this with Vue 3.5.14 by hydrating an existing That result is specific to a text mismatch with matching element structure. The attribute does not promise that structurally different server/client trees can hydrate without replacing nodes. Use the narrow If you need to avoid the text changing during hydration, render the same initial value on both sides, then update it after mounting. The SSR API documentation lists the allowed mismatch types; the 3.5.14 hydration implementation checks the warning condition separately from the text update. |
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I was looking to gain some clarity regarding the
data-allow-mismatchattribute as it pertains to SSR Hydration. I have many instances of Dates and Times that are mismatched on Server vs Client. If I applydata-allow-mismatchon the element - am I allowing hydration to proceed as normal OR am I just suppressing the warning and still have re-building, hydration issues?Thanks!
All reactions