Skip to content

Commit 3dcd5a4

Browse files
authored
fix docs (#14635)
1 parent c6fca02 commit 3dcd5a4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

documentation/docs/98-reference/.generated/shared-warnings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ The following properties cannot be cloned with `$state.snapshot` — the return
2323
`$state.snapshot` tries to clone the given value in order to return a reference that no longer changes. Certain objects may not be cloneable, in which case the original value is returned. In the following example, `property` is cloned, but `window` is not, because DOM elements are uncloneable:
2424

2525
```js
26-
const state = $state({ property: 'this is cloneable', window })
27-
const snapshot = $state.snapshot();
26+
const object = $state({ property: 'this is cloneable', window })
27+
const snapshot = $state.snapshot(object);
2828
```

packages/svelte/messages/shared-warnings/warnings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ Elements such as `<input>` cannot have content, any children passed to these ele
1515
`$state.snapshot` tries to clone the given value in order to return a reference that no longer changes. Certain objects may not be cloneable, in which case the original value is returned. In the following example, `property` is cloned, but `window` is not, because DOM elements are uncloneable:
1616

1717
```js
18-
const state = $state({ property: 'this is cloneable', window })
19-
const snapshot = $state.snapshot();
18+
const object = $state({ property: 'this is cloneable', window })
19+
const snapshot = $state.snapshot(object);
2020
```

0 commit comments

Comments
 (0)