File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " svelte " : patch
3+ ---
4+
5+ fix: relax constraint for ` ComponentProps `
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ export type ComponentEvents<Comp extends SvelteComponent> =
198198 * </script>
199199 * ```
200200 */
201- export type ComponentProps < Comp extends SvelteComponent | Component > =
201+ export type ComponentProps < Comp extends SvelteComponent | Component < any > > =
202202 Comp extends SvelteComponent < infer Props >
203203 ? Props
204204 : Comp extends Component < infer Props >
Original file line number Diff line number Diff line change @@ -231,6 +231,13 @@ functionComponentInstance.foo === 'bar';
231231// @ts -expect-error
232232functionComponentInstance . foo = 'foo' ;
233233
234+ const functionComponentProps : ComponentProps < typeof functionComponent > = {
235+ binding : true ,
236+ readonly : 'foo' ,
237+ // @ts -expect-error
238+ prop : 1
239+ } ;
240+
234241mount ( functionComponent , {
235242 target : null as any as Document | Element | ShadowRoot ,
236243 props : {
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ declare module 'svelte' {
195195 * </script>
196196 * ```
197197 */
198- export type ComponentProps < Comp extends SvelteComponent | Component > =
198+ export type ComponentProps < Comp extends SvelteComponent | Component < any > > =
199199 Comp extends SvelteComponent < infer Props >
200200 ? Props
201201 : Comp extends Component < infer Props >
You can’t perform that action at this time.
0 commit comments