Skip to content

Commit

Permalink
docs: fix ComponentProps info
Browse files Browse the repository at this point in the history
closes #13770
  • Loading branch information
dummdidumm committed Oct 23, 2024
1 parent 7ecc6c0 commit 728a805
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/svelte/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,12 @@ export type ComponentEvents<Comp extends SvelteComponent> =
* import MyComponent from './MyComponent.svelte';
*
* // Errors if these aren't the correct props expected by MyComponent.
* const props: ComponentProps<MyComponent> = { foo: 'bar' };
* const props: ComponentProps<typeof MyComponent> = { foo: 'bar' };
* ```
*
* > [!NOTE]
* > In Svelte 4, you would do `ComponentProps<MyComponent>` because `MyComponent` was a class.
*
* Example: A generic function that accepts some component and infers the type of its props:
*
* ```ts
Expand Down

0 comments on commit 728a805

Please sign in to comment.