From 50310978c3190a043cda0561753ed515552913c4 Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Fri, 5 Jul 2024 08:18:47 +0200 Subject: [PATCH] chore: add comments for overwrites --- packages/components/scripts/post-build/react.ts | 2 ++ packages/components/scripts/post-build/vue.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/components/scripts/post-build/react.ts b/packages/components/scripts/post-build/react.ts index a59459c63b3..aa7d6bfecfb 100644 --- a/packages/components/scripts/post-build/react.ts +++ b/packages/components/scripts/post-build/react.ts @@ -99,6 +99,8 @@ export default (tmp?: boolean) => { component?.config?.react?.propsPassingFilter ?? [] )})}` }, + /* We need to overwrite the internal state._value property just for react to have controlled components. + * It works for Angular & Vue, so we overwrite it only for React. */ { from: 'props.value ?? _value', to: 'props.value' diff --git a/packages/components/scripts/post-build/vue.ts b/packages/components/scripts/post-build/vue.ts index c1dff793277..6706269ad96 100644 --- a/packages/components/scripts/post-build/vue.ts +++ b/packages/components/scripts/post-build/vue.ts @@ -64,6 +64,7 @@ export default (tmp?: boolean) => { from: /immediate: true,/g, to: 'immediate: true,\nflush: "post"' }, + /* `this` can be undefined for ssr (nuxt) we need to add */ { from: /this.\$refs.ref\?.validationMessage/g, to: 'this?.$refs.ref?.validationMessage'