diff --git a/documentation/docs/03-template-syntax/01-basic-markup.md b/documentation/docs/03-template-syntax/01-basic-markup.md index b41dc187c337..cb29da45b829 100644 --- a/documentation/docs/03-template-syntax/01-basic-markup.md +++ b/documentation/docs/03-template-syntax/01-basic-markup.md @@ -158,6 +158,25 @@ Curly braces can be included in a Svelte template by using their [HTML entity](h If you're using a regular expression (`RegExp`) [literal notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#literal_notation_and_constructor), you'll need to wrap it in parentheses. +> [!NOTE] Svelte statically analyzes your code to determine what is actually reactive. As a result, if a text or attribute expression does not contain: +> - An object property +> - A function call +> - A reference to a reactive variable +> +> Then Svelte will treat it as a static expression that does not require updates. This means that this sort of statement would be treated as static, and would never update: +> ```svelte +> +> +> ``` +> In the above case, if you wanted the statement to be reactive, you would have to append `.toString()` to the expression (to turn `{thing}` into `{thing.toString()}`). + ```svelte