Skip to content

Commit 80ef6f1

Browse files
authored
Merge pull request #3127 from pngwn/3029-module-reactivity
Site: document that module script variables are not reactive. Closes …
2 parents cfee4ea + e05680d commit 80ef6f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

site/content/docs/01-component-format.md

+2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ You can `export` bindings from this block, and they will become exports of the c
176176

177177
You cannot `export default`, since the default export is the component itself.
178178

179+
> Variables defined in `module` scripts are not reactive — reassigning them will not trigger a rerender even though the variable itself will update. For values shared between multiple components, consider using a [store](https://svelte.dev/docs#svelte_store).
180+
179181
```html
180182
<script context="module">
181183
let totalComponents = 0;

0 commit comments

Comments
 (0)