Skip to content

Commit 18a7536

Browse files
Explain about context=module exports into Typescript
Document the issue from sveltejs#5817
1 parent 484588a commit 18a7536

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

documentation/docs/02-template-syntax/01-svelte-components.md

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

260260
You cannot `export default`, since the default export is the component itself.
261261

262+
> Note that if you are using TypeScript, exports from a `context="module"` block will not be exposed to TypeScript, and the type checker will complain about unknown members. If possible, it is preferable to export from TypeScript into Svelte, and only import Svelte components themselves into TypeScript.
263+
262264
> 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](/docs/svelte-store).
263265
264266
```svelte

0 commit comments

Comments
 (0)