From bcd822f77d8f1fe5faf88e8f4ea14e591af2c44f Mon Sep 17 00:00:00 2001 From: "Franklin \"Snaipe\" Mathieu" Date: Mon, 23 May 2022 19:33:30 +0200 Subject: [PATCH] [fix] allow use of document root as target in typescript It is not possible to use typescript when using `target: document` during component initialization, because target can only be of type Element or ShadowRoot. This means that it is not possible to hydrate the entire document when managing the element as a Svelte component. This commit fixes this by allowing documents to be targets. --- src/runtime/internal/dev.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts index 3144911672..75cd8d8680 100644 --- a/src/runtime/internal/dev.ts +++ b/src/runtime/internal/dev.ts @@ -129,7 +129,7 @@ export interface SvelteComponentDev { [accessor: string]: any; } interface IComponentOptions = Record> { - target: Element | ShadowRoot; + target: Element | Document | ShadowRoot; anchor?: Element; props?: Props; context?: Map;