You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/svelte/messages/client-warnings/warnings.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,9 +52,9 @@ The easiest way to log a value as it changes over time is to use the [`$inspect`
52
52
53
53
> 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
54
54
55
-
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.
55
+
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.
56
56
57
-
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:
57
+
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:
58
58
59
59
```svelte
60
60
<script>
@@ -83,9 +83,9 @@ To fix this, either silence the warning with an ignore comment, or ensure that t
83
83
84
84
> 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
85
85
86
-
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.
86
+
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.
87
87
88
-
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:
88
+
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:
89
89
90
90
```svelte
91
91
<script>
@@ -168,7 +168,7 @@ Consider the following code:
168
168
169
169
`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.
170
170
171
-
To fix it, either create callback props to communicate via events with `App`, or mark `person` as [`$bindable`]($bindable).
171
+
To fix it, either create callback props to communicate changes, or mark `person` as [`$bindable`]($bindable).
0 commit comments