Svelte · Middle · Question 50 of 75
How do you show a loading indicator during SvelteKit navigation?
<script>
import { navigating } from "$app/state";
</script>
{#if navigating.to}<ProgressBar />{/if}- ✓Correct answer: Read
navigatingfrom$app/state, which is non-null while a navigation is in progress - 2Listen to
window.onload - 3Use
{#await}around the whole layout
Explanation
navigating has from, to and type. On the server its values are null.