Skip to content

Commit e9667bf

Browse files
Apply suggestions from code review
Co-authored-by: Rich Harris <[email protected]>
1 parent 4b5b108 commit e9667bf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ The easiest way to log a value as it changes over time is to use the [`$inspect`
6666
The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value
6767
```
6868

69-
Certain attributes like `src` on an `<img>` element will not be repaired during hydration, i.e. the server value will be kept. That's because for some attributes it is very expensive to properly calculate whether or not their value has really changed.
69+
Certain attributes like `src` on an `<img>` element will not be repaired during hydration, i.e. the server value will be kept. That's because updating these attributes can cause the image to be refetched (or in the case of an `<iframe>`, for the frame to be reloaded), even if they resolve to the same resource.
7070

71-
To fix this, either silence the warning with an ignore comment, or ensure that the value stays the same between server and client. If you really need the value to change on hydration, you can force an update like this:
71+
To fix this, either silence the warning with a [`svelte-ignore`](basic-markup#Comments) comment, or ensure that the value stays the same between server and client. If you really need the value to change on hydration, you can force an update like this:
7272

7373
```svelte
7474
<script>
@@ -101,9 +101,9 @@ The value of an `{@html ...}` block changed between server and client renders. T
101101
The value of an `{@html ...}` block %location% changed between server and client renders. The client value will be ignored in favour of the server value
102102
```
103103
104-
If the a `{@html ...}` value changes between the server and the client, it will not be repaired during hydration, i.e. the server value will be kept. That's because it is very expensive to properly calculate whether or not their value have really changed.
104+
If the `{@html ...}` value changes between the server and the client, it will not be repaired during hydration, i.e. the server value will be kept. That's because change detection during hydration is expensive and usually unnecessary.
105105
106-
To fix this, either silence the warning with an ignore comment, or ensure that the value stays the same between server and client. If you really need the value to change on hydration, you can force an update like this:
106+
To fix this, either silence the warning with a [`svelte-ignore`](basic-markup#Comments) comment, or ensure that the value stays the same between server and client. If you really need the value to change on hydration, you can force an update like this:
107107
108108
```svelte
109109
<script>
@@ -202,7 +202,7 @@ Consider the following code:
202202
203203
`Child` is mutating `person` which is owned by `App` without being explicitly "allowed" to do so. This is strongly discouraged since it can create code that is hard to reason about at scale ("who mutated this value?"), hence the warning.
204204
205-
To fix it, either create callback props to communicate via events with `App`, or mark `person` as [`$bindable`]($bindable).
205+
To fix it, either create callback props to communicate changes, or mark `person` as [`$bindable`]($bindable).
206206
207207
### reactive_declaration_non_reactive_property
208208

0 commit comments

Comments
 (0)