-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: uniqueId mixin #5567
feat: uniqueId mixin #5567
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
4ac9cce
to
5da4c69
Compare
@@ -196,10 +196,6 @@ export default { | |||
type: String, | |||
default: null | |||
}, | |||
id: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was been dummy prop only for compute d_id (for a11y) in Calendar.vue: https://github.com/primefaces/primevue/pull/5567/files#diff-29f5ad83722c320c17555abd43c32dc15aa18759ca1894c22c6e1ea53d365bbaL548
Good job, @i7slegend! This is exactly what I wanted to do in v4. Currently, I'm working on v4.beta.2 release. I'll review this PR in more detail after beta.2. |
Many hydration issue in console. Thanks @i7slegend. Waiting for the merge :) |
I rewrote from mixin to composable, i bet it's best way to line with vue3 recommendations. Btw nuxt (since 3.10) have |
Could you check the latest updates? If you think the problem still exists, please let us know. Closing due to conflicts. Thanks for your contribution! |
Half-duplicate of #5486
#5486 not SSR-friendly (hydration warnings), so i could not find best way for Nuxt.
This MR implements uniqueId mixin (with UniqueComponentId under hood). This mixin uses mounted hook for SSR (like it was before my requests) but for not-SSR calculate unique id before mount that remove redudant re-render (bcz id changes after mount and this trigger re-render for component and his children in the dom tree).
New file:
components/lib/utils/UniqueIdMixinFactory.js
(placed in primevue/utils). Nuxt is detect by this condition:typeof window === 'undefined' || (typeof process !== 'undefined' && Boolean(process.client || process.server));