-
-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Labels
Description
Hey,
I'm currently going though the official tutorial and have noticed the following thing that won't make any sense to me:
Lines 2 to 15 in d382b43
let questions = $state([ | |
{ | |
id: 1, | |
text: `Where did you go to school?` | |
}, | |
{ | |
id: 2, | |
text: `What is your mother's name?` | |
}, | |
{ | |
id: 3, | |
text: `What is another personal fact that an attacker could easily find with Google?` | |
} | |
]); |
The array here is wrapped inside a $state
rune, but since it's never adjusted I'm not completely sure why that is. Removing the rune from it just seems to work flawlessly...
Lines 33 to 42 in d382b43
<select | |
value={selected} | |
onchange={() => (answer = '')} | |
> | |
{#each questions as question} | |
<option value={question}> | |
{question.text} | |
</option> | |
{/each} | |
</select> |
Do I miss something important/ idiomatic in Svelte, or is this indeed a small mistake?