Skip to content

fix: Address bugs in SvelteKit “Preloading” tutorial example #1334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BioniCosmos
Copy link

This PR fixes an issue in the SvelteKit “preloading” tutorial where the previous navigation details were lost after navigation. This occurred because previous directly referenced the mutable navigating object, causing it to update when navigating became null.

The fix ensures previous holds a snapshot of the navigation state at its inception by creating a shallow copy ({ ...navigating }) instead of a direct reference.

Correctly capture the previous navigation state.
Copy link

vercel bot commented May 12, 2025

@BioniCosmos is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant