Hint at the reactivity limitation of array methods in the api docs (#2622)

* Hint at the reactivity limitation of array methods in the api docs

* tweaks
pull/2649/head
Benjamin Milde 5 years ago committed by Conduitry
parent 511060ba94
commit e73084b6af

@ -56,6 +56,8 @@ To change component state and trigger a re-render, just assign to a locally decl
Update expressions (`count += 1`) and property assignments (`obj.x = y`) have the same effect.
Because Svelte's reactivity is based on assignments, using array methods like `.push()` and `.splice()` won't automatically trigger updates. Options for getting around this can be found in the [tutorial](tutorial/updating-arrays-and-objects).
```html
<script>
let count = 0;

Loading…
Cancel
Save