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