Skip to content

Commit eea6815

Browse files
committed
better support for root components
1 parent 9d851fc commit eea6815

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

runtime/svelte-hooks.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ export const createProxiedComponent = (
138138
return comp
139139
}
140140

141-
targetCmp.$$.on_before_hmr = []
142141
targetCmp.$$.on_hmr = []
143142

144143
// `conservative: true` means we want to be sure that the new component has
@@ -162,7 +161,12 @@ export const createProxiedComponent = (
162161
}
163162
) => {
164163
const restore = captureState(targetCmp)
165-
assignOptions(target, anchor, restore, preserveLocalState)
164+
assignOptions(
165+
target || options.target,
166+
anchor,
167+
restore,
168+
preserveLocalState
169+
)
166170

167171
const callbacks = cmp.$$.on_hmr
168172

0 commit comments

Comments
 (0)