Skip to content

Conversation

BioniCosmos
Copy link
Contributor

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.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dummdidumm dummdidumm merged commit 1cb9a6b into sveltejs:main Sep 6, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants