File tree 1 file changed +14
-5
lines changed
packages/runtime-core/src
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,19 @@ export function initProps(
177
177
instance . attrs = attrs
178
178
}
179
179
180
+ function inHmrContext ( instance : ComponentInternalInstance ) {
181
+ if ( instance . type . __hmrId ) {
182
+ return instance . type . __hmrId
183
+ }
184
+ let parent = instance . parent
185
+ while ( parent ) {
186
+ if ( parent . type . __file ) {
187
+ return parent . type . __hmrId
188
+ }
189
+ parent = parent . parent
190
+ }
191
+ }
192
+
180
193
export function updateProps (
181
194
instance : ComponentInternalInstance ,
182
195
rawProps : Data | null ,
@@ -196,11 +209,7 @@ export function updateProps(
196
209
// always force full diff in dev
197
210
// - #1942 if hmr is enabled with sfc component
198
211
// - vite#872 non-sfc component used by sfc component
199
- ! (
200
- __DEV__ &&
201
- ( instance . type . __hmrId ||
202
- ( instance . parent && instance . parent . type . __hmrId ) )
203
- ) &&
212
+ ! ( __DEV__ && inHmrContext ( instance ) ) &&
204
213
( optimized || patchFlag > 0 ) &&
205
214
! ( patchFlag & PatchFlags . FULL_PROPS )
206
215
) {
You can’t perform that action at this time.
0 commit comments