Skip to content

Commit 0c4c2b0

Browse files
authored
chore: use replaceState from SvelteKit to avoid warning (#11793)
1 parent d1f5d5d commit 0c4c2b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sites/svelte-5-preview/src/routes/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import { theme } from '@sveltejs/site-kit/stores';
33
import '@sveltejs/site-kit/styles/index.css';
4+
import { replaceState } from '$app/navigation';
45
56
import Repl from '$lib/Repl.svelte';
67
import { default_files } from './defaults.js';
@@ -69,10 +70,9 @@
6970
7071
setting_hash = true;
7172
72-
history.replaceState(
73-
history.state,
74-
'',
75-
`${location.pathname}${location.search}#${await compress_and_encode_text(json)}`
73+
replaceState(
74+
`${location.pathname}${location.search}#${await compress_and_encode_text(json)}`,
75+
{}
7676
);
7777
}
7878
</script>

0 commit comments

Comments
 (0)