Svelte · Junior · Question 33 of 76
Should a component mutate a prop object it received (not marked $bindable)?
- ✓Correct answer: No: the parent owns that state; Svelte warns about such mutations, so use callbacks or
$bindable - 2Yes, it's the normal way to update parent state
- 3Yes, but only arrays
Explanation
Mutating someone else's state makes data flow hard to follow. Let the owner change it.