treat `slot` the same as other props - closes #9455 (#9457)

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/9463/head
Rich Harris 1 year ago committed by GitHub
parent 6f6c3a0787
commit f5101c0d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: treat `slot` the same as other props

@ -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])

@ -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));

Loading…
Cancel
Save