Skip to content

Commit e1f3d75

Browse files
authored
docs: fix svelte app unmount code (#1673)
1 parent 030f23d commit e1f3d75

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

docs/guide/essentials/content-scripts.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ export default defineContentScript({
211211
anchor: 'body',
212212
onMount: (container) => {
213213
// Create the Svelte app inside the UI container
214-
mount(App, {
215-
target: container,
216-
});
214+
return mount(App, { target: container });
217215
},
218216
onRemove: (app) => {
219217
// Destroy the app when the UI is removed
@@ -396,11 +394,9 @@ export default defineContentScript({
396394
anchor: 'body',
397395
onMount: (container) => {
398396
// Create the Svelte app inside the UI container
399-
mount(App, {
400-
target: container,
401-
});
397+
return mount(App, { target: container });
402398
},
403-
onRemove: () => {
399+
onRemove: (app) => {
404400
// Destroy the app when the UI is removed
405401
unmount(app);
406402
},

0 commit comments

Comments
 (0)