Search code examples
routessvelteastrojs

Is there is way to preserve the state in astro


I would really like to know if there is a way of preserving states such as user data between routes in astro. I am also using the svelte framework.

I tried to use svelte stores but does not seem to work. I also tried to implement nano stores but that does not work either.


Solution

  • Astro currently suggests using nano stores, but in order to make nano stores persist across all pages you must use @nanostores/persistent