From e1f3d75ac45994ba0915f1b2c58c514cf44298f0 Mon Sep 17 00:00:00 2001 From: Hyunbin Seo <47051820+hyunbinseo@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:48:37 +0900 Subject: [PATCH] docs: fix svelte app unmount code (#1673) --- docs/guide/essentials/content-scripts.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/guide/essentials/content-scripts.md b/docs/guide/essentials/content-scripts.md index b9777af3..3c0c77a9 100644 --- a/docs/guide/essentials/content-scripts.md +++ b/docs/guide/essentials/content-scripts.md @@ -211,9 +211,7 @@ export default defineContentScript({ anchor: 'body', onMount: (container) => { // Create the Svelte app inside the UI container - mount(App, { - target: container, - }); + return mount(App, { target: container }); }, onRemove: (app) => { // Destroy the app when the UI is removed @@ -396,11 +394,9 @@ export default defineContentScript({ anchor: 'body', onMount: (container) => { // Create the Svelte app inside the UI container - mount(App, { - target: container, - }); + return mount(App, { target: container }); }, - onRemove: () => { + onRemove: (app) => { // Destroy the app when the UI is removed unmount(app); },