Skip to content

Commit f5101c0

Browse files
authored
treat slot the same as other props - closes #9455 (#9457)
Co-authored-by: Rich Harris <[email protected]>
1 parent 6f6c3a0 commit f5101c0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.changeset/tiny-kings-whisper.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: treat `slot` the same as other props

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,6 @@ function serialize_inline_component(node, component_name, context) {
710710
} else if (attribute.type === 'SpreadAttribute') {
711711
props_and_spreads.push(/** @type {import('estree').Expression} */ (context.visit(attribute)));
712712
} else if (attribute.type === 'Attribute') {
713-
if (attribute.name === 'slot') continue;
714713
if (attribute.name.startsWith('--')) {
715714
custom_css_props.push(
716715
b.init(attribute.name, serialize_attribute_value(attribute.value, context)[1])

packages/svelte/src/compiler/phases/3-transform/server/transform-server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ function serialize_inline_component(node, component_name, context) {
782782
} else if (attribute.type === 'SpreadAttribute') {
783783
props_and_spreads.push(/** @type {import('estree').Expression} */ (context.visit(attribute)));
784784
} else if (attribute.type === 'Attribute') {
785-
if (attribute.name === 'slot') continue;
786785
if (attribute.name.startsWith('--')) {
787786
const value = serialize_attribute_value(attribute.value, context, false, true);
788787
custom_css_props.push(b.init(attribute.name, value));

0 commit comments

Comments
 (0)