Merge pull request #3127 from pngwn/3029-module-reactivity

Site: document that module script variables are not reactive. Closes …
pull/3139/head
Rich Harris 6 years ago committed by GitHub
commit 80ef6f190d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -176,6 +176,8 @@ You can `export` bindings from this block, and they will become exports of the c
You cannot `export default`, since the default export is the component itself. You cannot `export default`, since the default export is the component itself.
> 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).
```html ```html
<script context="module"> <script context="module">
let totalComponents = 0; let totalComponents = 0;

Loading…
Cancel
Save