Skip to content

Commit 49d8a21

Browse files
committed
fix
1 parent 2e9b3e3 commit 49d8a21

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/svelte/messages/compile-warnings/template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ In some cases `<object.property>` syntax can be used as a replacement; a lowerca
7474

7575
For complex component resolution logic, an intermediary, capitalized variable may be necessary. E.g. in places where `@const` can be used:
7676

77+
<!-- prettier-ignore -->
7778
```svelte
7879
{#each items as item}
7980
---<svelte:component this={item.condition ? Y : Z} />---
@@ -84,12 +85,14 @@ For complex component resolution logic, an intermediary, capitalized variable ma
8485

8586
A derived value may be used in other contexts:
8687

88+
<!-- prettier-ignore -->
8789
```svelte
8890
<script>
8991
// ...
9092
let condition = $state(false);
9193
+++const Component = $derived(condition ? Y : Z);+++
9294
</script>
95+
9396
---<svelte:component this={condition ? Y : Z} />---
9497
+++<Component />+++
9598
```

0 commit comments

Comments
 (0)