mirror of https://github.com/sveltejs/svelte
fix: avoid shadowing a variable in dynamic components (#16185)
* fix: avoid shadowing a variable in dynamic components * split component name and intermediate name --------- Co-authored-by: 7nik <kifiranet@gmail.com>pull/16195/head
parent
061ab31d23
commit
838f881550
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: avoid shadowing a variable in dynamic components
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
const { children } = $props()
|
||||
</script>
|
||||
|
||||
{@render children()}
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
import { flushSync } from 'svelte';
|
||||
|
||||
export default test({
|
||||
async test({ assert, target }) {
|
||||
assert.htmlEqual(target.innerHTML, 'test');
|
||||
}
|
||||
});
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
import A from './A.svelte';
|
||||
|
||||
const B = $derived(A);
|
||||
</script>
|
||||
|
||||
<B>
|
||||
<B>test</B>
|
||||
</B>
|
Loading…
Reference in new issue