Skip to content

Commit

Permalink
Fix generic props relationship in SvelteComponentTyped (#6400)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dummdidumm authored Jun 13, 2021
1 parent 6e9ecd8 commit c5f588e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/internal/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface SvelteComponentDev {
$destroy(): void;
[accessor: string]: any;
}
interface IComponentOptions {
interface IComponentOptions<Props extends Record<string, any> = Record<string, any>> {
target: Element;
anchor?: Element;
props?: Props;
Expand Down Expand Up @@ -232,7 +232,7 @@ export class SvelteComponentTyped<
*/
$$slot_def: Slots;

constructor(options: IComponentOptions) {
constructor(options: IComponentOptions<Props>) {
super(options);
}
}
Expand Down

0 comments on commit c5f588e

Please sign in to comment.