@ -120,7 +120,9 @@ export function build_inline_component(node, expression, context) {
push _prop ( b . prop ( 'init' , child . expression , child . expression ) ) ;
push _prop ( b . prop ( 'init' , child . expression , child . expression ) ) ;
// Interop: allows people to pass snippets when component still uses slots
// Interop: allows people to pass snippets when component still uses slots
serialized _slots . push ( b . init ( child . expression . name , b . true ) ) ;
serialized _slots . push (
b . init ( child . expression . name === 'children' ? 'default' : child . expression . name , b . true )
) ;
continue ;
continue ;
}
}
@ -200,7 +202,11 @@ export function build_inline_component(node, expression, context) {
if ( slot _name === 'default' && ! has _children _prop ) {
if ( slot _name === 'default' && ! has _children _prop ) {
if (
if (
lets . default . length === 0 &&
lets . default . length === 0 &&
children . default . every ( ( node ) => node . type !== 'SvelteFragment' )
children . default . every (
( node ) =>
node . type !== 'SvelteFragment' ||
! node . attributes . some ( ( attr ) => attr . type === 'LetDirective' )
)
) {
) {
// create `children` prop...
// create `children` prop...
push _prop ( b . prop ( 'init' , b . id ( 'children' ) , slot _fn ) ) ;
push _prop ( b . prop ( 'init' , b . id ( 'children' ) , slot _fn ) ) ;