Skip to content

Commit

Permalink
docs: enhance migration docs about accessors
Browse files Browse the repository at this point in the history
related to #15134
  • Loading branch information
dummdidumm committed Jan 29, 2025
1 parent 5e9b29c commit 890d654
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion documentation/docs/07-misc/07-v5-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,26 @@ If a bindable property has a default value (e.g. `let { foo = $bindable('bar') }
### `accessors` option is ignored
Setting the `accessors` option to `true` makes properties of a component directly accessible on the component instance. In runes mode, properties are never accessible on the component instance. You can use component exports instead if you need to expose them.
Setting the `accessors` option to `true` makes properties of a component directly accessible on the component instance.
```svelte
<svelte:options accessors={true} />

<script>
// available via componentInstance.name
export let name;
</script>
```
In runes mode, properties are never accessible on the component instance. You can use component exports instead if you need to expose them.
```svelte
<script>
let { name } = $props();
// available via componentInstance.getName()
export const getName = () => name;
</script>
```
### `immutable` option is ignored
Expand Down

0 comments on commit 890d654

Please sign in to comment.