From 9f4147fca0e47dca1f3ef35fceba6cb7829e7813 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Sun, 13 Jun 2021 12:56:01 +0200 Subject: [PATCH] Fix generic props relationship in SvelteComponentTyped (#6400) A recent refactoring commit where the constructor definition was moved to an interface disconnected the props relationship of the props that are passed in the constructor and the instance props --- CHANGELOG.md | 1 + src/runtime/internal/dev.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89249634bb..b78b8ab37d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased * Fix type signatures of `writable` and `readable`. It's possible to invoke them without arguments ([#6291](https://github.com/sveltejs/svelte/issues/6291), [#6345](https://github.com/sveltejs/svelte/issues/6345)) +* Fix generic props relationship in SvelteComponentTyped ([#6400](https://github.com/sveltejs/svelte/pull/6400)) ## 3.38.2 diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts index 8e67b0f61b..8a7415d872 100644 --- a/src/runtime/internal/dev.ts +++ b/src/runtime/internal/dev.ts @@ -104,7 +104,7 @@ export interface SvelteComponentDev { $destroy(): void; [accessor: string]: any; } -interface IComponentOptions { +interface IComponentOptions = Record> { target: Element; anchor?: Element; props?: Props; @@ -232,7 +232,7 @@ export class SvelteComponentTyped< */ $$slot_def: Slots; - constructor(options: IComponentOptions) { + constructor(options: IComponentOptions) { super(options); } }