-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
feature / enhancementNew feature or requestNew feature or request
Milestone
Description
Describe the problem
See: https://nextjs.org/docs/routing/shallow-routing
Shallow routing allows you to change the URL without running data fetching methods again, (...) [it] only works for same page URL changes.
Describe the proposed solution
import { goto } from '$app/navigation';
await goto(href, { shallow: true });plus
<a sveltekit:shallow {href}></a>These would update the page store, but load would not run. (Only if href does not link to a new page)
Alternatives considered
Using the History API directly:
history.replaceState(history.state, document.title, href)But doing this does not update the page store (and it's ugly).
Importance
would make my life easier
Additional Information
I have this OrgTree component which lazy loads it's items as you expand the groups:
When you click an item the URI is updated using shallow routing, leaving all the loaded tree data intact.
Using Svelte Kit, load fetches the initial tree data, but, after navigating, the initial data is loaded again, reseting the whole tree.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature / enhancementNew feature or requestNew feature or request
