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 @@ -178,6 +178,19 @@ 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
191
+ }
192
+ }
193
+
181
194
export function updateProps (
182
195
instance : ComponentInternalInstance ,
183
196
rawProps : Data | null ,
@@ -197,11 +210,7 @@ export function updateProps(
197
210
// always force full diff in dev
198
211
// - #1942 if hmr is enabled with sfc component
199
212
// - vite#872 non-sfc component used by sfc component
200
- ! (
201
- __DEV__ &&
202
- ( instance . type . __hmrId ||
203
- ( instance . parent && instance . parent . type . __hmrId ) )
204
- ) &&
213
+ ! ( __DEV__ && inHmrContext ( instance ) ) &&
205
214
( optimized || patchFlag > 0 ) &&
206
215
! ( patchFlag & PatchFlags . FULL_PROPS )
207
216
) {
You can’t perform that action at this time.
0 commit comments