File tree 2 files changed +6
-15
lines changed
packages/runtime-core/src
2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -424,14 +424,9 @@ function injectToKeepAliveRoot(
424
424
}
425
425
426
426
function resetShapeFlag ( vnode : VNode ) {
427
- let shapeFlag = vnode . shapeFlag
428
- if ( shapeFlag & ShapeFlags . COMPONENT_SHOULD_KEEP_ALIVE ) {
429
- shapeFlag -= ShapeFlags . COMPONENT_SHOULD_KEEP_ALIVE
430
- }
431
- if ( shapeFlag & ShapeFlags . COMPONENT_KEPT_ALIVE ) {
432
- shapeFlag -= ShapeFlags . COMPONENT_KEPT_ALIVE
433
- }
434
- vnode . shapeFlag = shapeFlag
427
+ // bitwise operations to remove keep alive flags
428
+ vnode . shapeFlag &= ~ ShapeFlags . COMPONENT_SHOULD_KEEP_ALIVE
429
+ vnode . shapeFlag &= ~ ShapeFlags . COMPONENT_KEPT_ALIVE
435
430
}
436
431
437
432
function getInnerChild ( vnode : VNode ) {
Original file line number Diff line number Diff line change @@ -358,13 +358,9 @@ export function isSameVNodeType(n1: VNode, n2: VNode): boolean {
358
358
hmrDirtyComponents . has ( n2 . type as ConcreteComponent )
359
359
) {
360
360
// #7042, ensure the vnode being unmounted during HMR
361
- if ( n1 . shapeFlag & ShapeFlags . COMPONENT_SHOULD_KEEP_ALIVE ) {
362
- n1 . shapeFlag -= ShapeFlags . COMPONENT_SHOULD_KEEP_ALIVE
363
- }
364
- // #7042, ensure the vnode being mounted as fresh during HMR
365
- if ( n2 . shapeFlag & ShapeFlags . COMPONENT_KEPT_ALIVE ) {
366
- n2 . shapeFlag -= ShapeFlags . COMPONENT_KEPT_ALIVE
367
- }
361
+ // bitwise operations to remove keep alive flags
362
+ n1 . shapeFlag &= ~ ShapeFlags . COMPONENT_SHOULD_KEEP_ALIVE
363
+ n2 . shapeFlag &= ~ ShapeFlags . COMPONENT_KEPT_ALIVE
368
364
// HMR only: if the component has been hot-updated, force a reload.
369
365
return false
370
366
}
You can’t perform that action at this time.
0 commit comments