File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,20 @@ export function hmrReload(
46
46
setCurrentInstance ( ...prev )
47
47
mountComponent ( newInstance , parent , anchor )
48
48
49
- // update parentInstance.block to ensure that the correct parent and
50
- // anchor are found during parentInstance HMR rerender/reload, as
51
- // `normalizeBlock` relies on the current instance.block
49
+ updateParentBlockOnHmrReload ( parentInstance , instance , newInstance )
50
+ }
51
+
52
+ /**
53
+ * dev only
54
+ * update parentInstance.block to ensure that the correct parent and
55
+ * anchor are found during parentInstance HMR rerender/reload, as
56
+ * `normalizeBlock` relies on the current instance.block
57
+ */
58
+ function updateParentBlockOnHmrReload (
59
+ parentInstance : VaporComponentInstance | null ,
60
+ instance : VaporComponentInstance ,
61
+ newInstance : VaporComponentInstance ,
62
+ ) : void {
52
63
if ( parentInstance ) {
53
64
if ( parentInstance . block === instance ) {
54
65
parentInstance . block = newInstance
You can’t perform that action at this time.
0 commit comments