Svelte · Middle · Question 45 of 75
What are beforeNavigate and afterNavigate used for?
- ✓Correct answer: Running code around client-side navigation, e.g. warning about unsaved changes or tracking page views
- 2Server-side redirects
- 3Prefetching images
Explanation
beforeNavigate can cancel navigation. onNavigate is handy for the View Transitions API.