docs: fix ComponentProps info (#13827)

* docs: fix ComponentProps info

closes #13770

* fix
pull/13839/head
Simon H 11 months ago committed by GitHub
parent 2d69a64e4e
commit c603553e89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -210,9 +210,11 @@ 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

@ -207,9 +207,11 @@ declare module 'svelte' {
* 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

Loading…
Cancel
Save