Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/12373/head
Simon H 2 years ago committed by GitHub
parent ded3a69820
commit 770bd5497a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -294,16 +294,10 @@ In Svelte 4, when the value of an `<img src={...}>` attribute or a `{@html ...}`
<script> <script>
import { onMount, tick } from 'svelte'; import { onMount, tick } from 'svelte';
let raw_html = $state( let server = typeof window === 'undefined';
typeof window === 'undefined'
? '<h1>Server</h1>' let markup = $state(server ? '<h1>Server</h1>' : '<h1>Client</h1>');
: '<h1>Client</h1>' let src = $state(server ? '/server.jpg' : '/client.jpg');
);
let src = $state(
typeof window === 'undefined'
? '/server.jpg'
: '/client.jpg'
);
onMount(async () => { onMount(async () => {
// force update // force update

Loading…
Cancel
Save