Comments (4)
upd. isMounted inside a component solves the problem, but should we add a check everywhere? It's almost as if :style itself is defective
:style="{ paddingRight: isMounted ?
${widthCartButton + 10}px : 0 }"
upd2. Is there some kind of lifecycle hook that would indicate the end of hydration of the entire application?
from core.
We don't know what useElementSize
is doing underneath, please provide a runnable reproduction instead of code snippets.
from core.
We don't know what
useElementSize
is doing underneath, please provide a runnable reproduction instead of code snippets.
I made minimal reproduction: https://github.com/DaniilIsupov/reproduction-hydration
In my example at App.vue
I can't wait when all child components are mounted
Because of this prop.count
value is being updated until hydration is complete
from core.
We don't know what
useElementSize
is doing underneath, please provide a runnable reproduction instead of code snippets.I made minimal reproduction: https://github.com/DaniilIsupov/reproduction-hydration In my example at
App.vue
I can't wait when all child components are mounted Because of thisprop.count
value is being updated until hydration is complete
Yes, this is the crux of the problem
useElementSize is a VueUse helper, but that's not important
The fact is that in large difficulty applications, some components are mounted before others, which leads to hydration errors when changing some parameters depending on the client side. In my case, VueUse useElementSize passes the width from the client and causes the style attribute of the not yet mounted component to change and throws an error
However, this is very difficult to reproduce in a minimal example, since the components are mounted almost simultaneously
Therefore, when accessing a client entity in one place, we cannot be sure that all components in which changes will occur have already been mounted and hydration has been completed
from core.
Related Issues (20)
- Inconsistency order of `created` hook between component and custom directive HOT 1
- V-show isn't working on an element with a style attribute HOT 1
- vue 3.4.18 (since 3.4.16) with vite 5.1.1 and rollup-typescript-plugin2 (ui-kit) build error HOT 3
- (v-model): v-model setter function not working properly when returning a constant value HOT 1
- The default value of defineModel is not ssr friendly HOT 1
- Hydration style mismatch HOT 1
- `modelValue` doesn't update value by `Array.push` if using assigning HOT 3
- mismatched child nodes count in `patchBlockChildren` when rendering component returning render function in JSX from `computed()` with `<slot v-if="ref">` HOT 1
- Custom Web Elements/Components receive `null` instead of `false` on subsequent re-render HOT 2
- Execution of click event in v-for area in combination with change of outer ref triggers re-rendering of whole list HOT 3
- Vue compiler adds import of mergeModels from vue, while it is not exposed in typings. HOT 5
- Facebook Appeal link not working
- Nested v-show ignores 'outer' value, and component with v-show="false" is shown. HOT 3
- [Vue warn] Computed is still dirty after getter evaluation HOT 22
- Serverless function not installing dependencies HOT 1
- Script Setup Does Not Populate Name Property HOT 2
- defineModel value de-synchronizes between parent and child if @update handler is not provided HOT 2
- style is not cleared HOT 3
- css v-bind can't work in vue-cli HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.