Skip to content

Commit 728a805

Browse files
committed
docs: fix ComponentProps info
closes #13770
1 parent 7ecc6c0 commit 728a805

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/svelte/src/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,12 @@ export type ComponentEvents<Comp extends SvelteComponent> =
210210
* import MyComponent from './MyComponent.svelte';
211211
*
212212
* // Errors if these aren't the correct props expected by MyComponent.
213-
* const props: ComponentProps<MyComponent> = { foo: 'bar' };
213+
* const props: ComponentProps<typeof MyComponent> = { foo: 'bar' };
214214
* ```
215215
*
216+
* > [!NOTE]
217+
* > In Svelte 4, you would do `ComponentProps<MyComponent>` because `MyComponent` was a class.
218+
*
216219
* Example: A generic function that accepts some component and infers the type of its props:
217220
*
218221
* ```ts

0 commit comments

Comments
 (0)