fix: migration script messing with attributes (#14260)

pull/14251/head
Paolo Ricciuti 10 months ago committed by GitHub
parent ae9f53a3bd
commit 653f4accbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: migration script messing with attributes

@ -1309,7 +1309,7 @@ const template = {
parent.type === 'RegularElement' ||
parent.type === 'SvelteElement' ||
parent.type === 'SvelteFragment') &&
parent.attributes.some((attr) => (attr.type = 'LetDirective'))
parent.attributes.some((attr) => attr.type === 'LetDirective')
)
) {
aliased_slot_name = `${name}_render`;

@ -0,0 +1,5 @@
<MyComponent
variant="outlined"
>
<slot />
</MyComponent>

@ -0,0 +1,15 @@
<script>
/**
* @typedef {Object} Props
* @property {import('svelte').Snippet} [children]
*/
/** @type {Props} */
let { children } = $props();
</script>
<MyComponent
variant="outlined"
>
{@render children?.()}
</MyComponent>
Loading…
Cancel
Save