diff --git a/.changeset/tiny-kings-whisper.md b/.changeset/tiny-kings-whisper.md new file mode 100644 index 000000000000..e1e5c3a01dba --- /dev/null +++ b/.changeset/tiny-kings-whisper.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: treat `slot` the same as other props diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js index b4007e79fd1f..a8ac31593498 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js @@ -710,7 +710,6 @@ function serialize_inline_component(node, component_name, context) { } else if (attribute.type === 'SpreadAttribute') { props_and_spreads.push(/** @type {import('estree').Expression} */ (context.visit(attribute))); } else if (attribute.type === 'Attribute') { - if (attribute.name === 'slot') continue; if (attribute.name.startsWith('--')) { custom_css_props.push( b.init(attribute.name, serialize_attribute_value(attribute.value, context)[1]) diff --git a/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js b/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js index f0800fedc662..794a52995eb9 100644 --- a/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js +++ b/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js @@ -782,7 +782,6 @@ function serialize_inline_component(node, component_name, context) { } else if (attribute.type === 'SpreadAttribute') { props_and_spreads.push(/** @type {import('estree').Expression} */ (context.visit(attribute))); } else if (attribute.type === 'Attribute') { - if (attribute.name === 'slot') continue; if (attribute.name.startsWith('--')) { const value = serialize_attribute_value(attribute.value, context, false, true); custom_css_props.push(b.init(attribute.name, value));