Skip to content

Commit 5974b57

Browse files
committed
more
1 parent 890d654 commit 5974b57

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

documentation/docs/07-misc/07-v5-migration-guide.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,19 @@ In runes mode, properties are never accessible on the component instance. You ca
743743
</script>
744744
```
745745
746+
Alternatively, if the place where they are instantiated is under your control, you can also make use of runes inside `.js/.ts` files by adjusting their ending to include `.svelte`, i.e. `.svelte.js` or `.svelte.ts`, and then use `$state`:
747+
748+
```js
749+
+++import { mount } from 'svelte';+++
750+
import App from './App.svelte'
751+
752+
---const app = new App({ target: document.getElementById("app"), props: { foo: 'bar' } });
753+
app.foo = 'baz'---
754+
+++const props = $state({ foo: 'bar' });
755+
const app = mount(App, { target: document.getElementById("app"), props });
756+
props.foo = 'baz';+++
757+
```
758+
746759
### `immutable` option is ignored
747760
748761
Setting the `immutable` option has no effect in runes mode. This concept is replaced by how `$state` and its variations work.

0 commit comments

Comments
 (0)