clarification

pull/7191/head
Gabor Szabo 5 years ago committed by GitHub
parent 883dfecb3c
commit 51fe7d402d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
title: Updating arrays and objects
---
Because Svelte's reactivity is triggered by assignments, using array methods like `push` and `splice` won't automatically cause updates. For example, clicking the button doesn't do anything.
Because Svelte's reactivity is triggered by assignments, using array methods like `push` and `splice` won't automatically cause updates. For example, clicking the button calls the `addNumber` function, but doesn't trigger the recalculation of `sum` and does not update the rendered page.
One way to fix that is to add an assignment that would otherwise be redundant:

Loading…
Cancel
Save