Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Sveltekit: Get last visited route

$
0
0

I've been trying to get the last visited route, after googling for long time I'm not able to find anything, it looks like is not so simple as it sounds, is it?

What I want is to store the last visited route in a state all of this in order to preload data from ssr when pressing a go back button.

This is an error page so idk from what page the user is coming.

I'm using sveltekit 2.

<button  on:click={() => goto('previous-route-here')}  on:mouseenter={async () => await preloadData('previous-route-here')}>  Go Back</botton>

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>