From 4cc468a61554bc53b185ab7a52b81a8d304646a1 Mon Sep 17 00:00:00 2001 From: Adam Rackis Date: Fri, 27 Nov 2020 14:59:53 -0600 Subject: [PATCH] Add clarification on what makes a reactive block reactive to docs. --- site/content/docs/01-component-format.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/site/content/docs/01-component-format.md b/site/content/docs/01-component-format.md index 8eac5d3c50..b9378b6769 100644 --- a/site/content/docs/01-component-format.md +++ b/site/content/docs/01-component-format.md @@ -130,6 +130,24 @@ Any top-level statement (i.e. not inside a block or a function) can be made reac --- +Only values which directly appear within the `$:` block will become dependencies of the reactive statement. For example, in the code below `total` will only update when `x` or `y` change, but not `z`. + +```sv + +``` + +--- + If a statement consists entirely of an assignment to an undeclared variable, Svelte will inject a `let` declaration on your behalf. ```sv