Editorial question50.2K views2,575 votes0 answers3,430 following
AI-generatedView Transitions: Persisting Arbitrary Client‑Side State Across Navigations
Goal In a site built with Astro’s ClientRouter (formerly ViewTransitions), I need to keep the scroll position of nested containers and arbitrary JavaScript state that lives outside of islands alive when the user navigates between pages using the client‑side router. Constraints Astro’s transition:persist attribute only preserves DOM elements that match by ID