chore: simplify slots

pull/16765/head
Rich Harris 11 months ago
parent aaaf428cce
commit faec3f0eb9

@ -227,14 +227,7 @@ export function build_inline_component(node, expression, context) {
params.push(pattern);
}
const slot_fn = b.arrow(
params,
// TODO: This will always produce correct results because it will always produce async functions
// if the current component is an async component, but it may produce async functions where they're
// not necessary -- eg. when the component is asynchronous but the child content is not.
// May or may not be worth optimizing.
b.block([call_child_payload(b.block(block.body), node.fragment.metadata.is_async)])
);
const slot_fn = b.arrow(params, b.block(block.body));
if (slot_name === 'default' && !has_children_prop) {
if (

@ -15,9 +15,7 @@ export default function Function_prop_no_getter($$payload) {
onmouseenter: () => count = plusOne(count),
children: ($$payload) => {
$$payload.child(($$payload) => {
$$payload.push(`<!---->clicks: ${$.escape(count)}`);
});
},
$$slots: { default: true }

Loading…
Cancel
Save