diff --git a/site/content/docs/01-component-format.md b/site/content/docs/01-component-format.md index 1c64094002..23508b5c7b 100644 --- a/site/content/docs/01-component-format.md +++ b/site/content/docs/01-component-format.md @@ -55,9 +55,7 @@ In development mode (see the [compiler options](/docs#compile-time-svelte-compil --- -If you export a `const`, `class` or `function`, it is readonly from outside the component. Function *expressions* are valid props, however. - -Readonly props can be accessed as properties on the element, tied to the component using [`bind:this` syntax](/docs#template-syntax-component-directives-bind-this). +If you export a `const`, `class` or `function`, it is readonly from outside the component. Functions are valid prop values, however, as shown below. ```sv ``` +Readonly props can be accessed as properties on the element, tied to the component using [`bind:this` syntax](/docs#template-syntax-component-directives-bind-this). + --- You can use reserved words as prop names. @@ -125,15 +125,29 @@ Because Svelte's reactivity is based on assignments, using array methods like `. ``` +--- + +Svelte's ` +``` + #### 3. `$:` marks a statement as reactive --- -Any top-level statement (i.e. not inside a block or a function) can be made reactive by prefixing it with the `$:` [JS label syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label). Reactive statements run immediately before the component updates, whenever the values that they depend on have changed. +Any top-level statement (i.e. not inside a block or a function) can be made reactive by prefixing it with the `$:` [JS label syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label). Reactive statements run after other script code and before the component markup is rendered, whenever the values that they depend on have changed. ```sv ```