mirror of https://github.com/sveltejs/svelte
fix: don't spread away `$$slots` from `$props` is it's used (#15849)
* fix: don't spread away `$$slots` from `$props` is it's used * beef up test * fix * Update .changeset/ten-plants-carry.md --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/15904/head
parent
2bc2ae0ddd
commit
944ef1dbce
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: don't redeclare `$$slots`
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
const props = $props();
|
||||
</script>
|
||||
|
||||
<p>{Object.keys(props)}</p>
|
||||
|
||||
{#if $$slots.foo}
|
||||
<p>foo exists</p>
|
||||
{/if}
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `
|
||||
<p>a</p>
|
||||
<p>foo exists</p>
|
||||
`
|
||||
});
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import Child from './Child.svelte';
|
||||
</script>
|
||||
|
||||
<Child a="b">
|
||||
<div slot="foo">foo</div>
|
||||
</Child>
|
Loading…
Reference in new issue