We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b30d5e commit 9b98894Copy full SHA for 9b98894
README.md
@@ -22,18 +22,17 @@ A `.svelte` file would look something like this:
22
23
```html
24
<script>
25
- let count = 1;
+ let count = $state(1);
26
27
- // the `$:` means 're-run whenever these values change'
28
- $: doubled = count * 2;
29
- $: quadrupled = doubled * 2;
+ let doubled = $derived(count * 2);
+ let quadrupled = $derived(doubled * 2);
30
31
function handleClick() {
32
count += 1;
33
}
34
</script>
35
36
-<button on:click="{handleClick}">Count: {count}</button>
+<button onclick={handleClick}>Count: {count}</button>
37
38
<p>{count} * 2 = {doubled}</p>
39
<p>{doubled} * 2 = {quadrupled}</p>
0 commit comments