From b750aaa46d27a458a9f881f8780679a64769cf32 Mon Sep 17 00:00:00 2001 From: Fox Date: Wed, 6 Nov 2019 15:42:59 +0100 Subject: [PATCH] site/tutorials - Added extra explanation for object reactivity --- .../02-reactivity/04-updating-arrays-and-objects/text.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md b/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md index b70b09f728..e637513d15 100644 --- a/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md +++ b/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md @@ -30,3 +30,12 @@ function addNumber() { numbers[numbers.length] = numbers.length + 1; } ``` +As a rule of thumb _The name of the reactive variable must appear on the left side of the equals to react to assignments._ + +For example, this case wouldn't work: +```js +const childRef = obj.foo; +childRef.bar = "new value"; +``` + +And to make it work it would be needed to force an update to object with `obj = obj`.