diff --git a/site/content/docs/02-component-format.md b/site/content/docs/02-component-format.md index 23508b5c7b..f2d1c2061a 100644 --- a/site/content/docs/02-component-format.md +++ b/site/content/docs/02-component-format.md @@ -192,6 +192,25 @@ Total: {total} ``` +--- +Is important to note that the reactive blocks are ordered via simple static analysis at compile time, and all the compiler looks at are the variables that are assigned to and used within the block itself, not in any functions called by them. This means that `yDependant` will not be updated in the following example: + +```sv + +``` + +Moving the line `$: yDependant = y` bellow `$: setY(x)` will update `yDependant`. + --- If a statement consists entirely of an assignment to an undeclared variable, Svelte will inject a `let` declaration on your behalf.