We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ecc6c0 commit 728a805Copy full SHA for 728a805
packages/svelte/src/index.d.ts
@@ -210,9 +210,12 @@ export type ComponentEvents<Comp extends SvelteComponent> =
210
* import MyComponent from './MyComponent.svelte';
211
*
212
* // Errors if these aren't the correct props expected by MyComponent.
213
- * const props: ComponentProps<MyComponent> = { foo: 'bar' };
+ * const props: ComponentProps<typeof MyComponent> = { foo: 'bar' };
214
* ```
215
216
+ * > [!NOTE]
217
+ * > In Svelte 4, you would do `ComponentProps<MyComponent>` because `MyComponent` was a class.
218
+ *
219
* Example: A generic function that accepts some component and infers the type of its props:
220
221
* ```ts
0 commit comments