From e73084b6affd9ebfc275857897a51df58095b6b4 Mon Sep 17 00:00:00 2001 From: Benjamin Milde Date: Wed, 1 May 2019 03:51:51 +0200 Subject: [PATCH] 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 --- site/content/docs/01-component-format.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/site/content/docs/01-component-format.md b/site/content/docs/01-component-format.md index d116dd8ff4..93af09b283 100644 --- a/site/content/docs/01-component-format.md +++ b/site/content/docs/01-component-format.md @@ -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