Skip to content

Commit 1d8d38c

Browse files
authored
fix: correctly validate <svelte:component> with bind:this (#12368)
1 parent 529db97 commit 1d8d38c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.changeset/witty-sloths-impress.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: correctly validate `<svelte:component>` with `bind:this`

packages/svelte/src/internal/client/dom/elements/bindings/this.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ export function bind_this(element_or_component = {}, update, get_value, get_part
5656
});
5757
};
5858
});
59+
60+
return element_or_component;
5961
}

packages/svelte/src/internal/client/validate.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ function is_void(tag) {
1212
}
1313

1414
/**
15-
* @param {() => any} component_fn
16-
* @returns {any}
15+
* @template Component
16+
* @param {() => Component} component_fn
17+
* @returns {Component}
1718
*/
1819
export function validate_dynamic_component(component_fn) {
1920
try {

0 commit comments

Comments
 (0)