-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
goto(url, { replaceState: true, invalidateAll: false }) still calls load function IF load function reads URL #9390
Comments
Found a work around! Rather then touch the url the load function provides, get a new url via
Then carry on! Load function stops being called on goto()! May wanna look into this though! Thank you for such a lovely creation! |
Solution causes anchors on the page that update the params to not call the load function, so not really a solution :( |
This allows request in load function to get url + anchors on page that update params
|
We lose the benefits of client side routing with the above solution btw |
Closing as duplicate of #6294, because that feature would solve your problem. |
Describe the bug
goto(url, { replaceState: true, invalidateAll: false })
calls load function (even ifgoto()
only updates params) only if we access the url provided to the load functionExample:
Reproduction
Created a tiny reproduction case
https://stackblitz.com/edit/sveltejs-kit-template-default-9jjrby?file=src/routes/test/+page.server.js
Goal:
Somehow be able to access url in the load function for first render and then do a replaceState on button click w/o calling the load function again
Logs
No response
System Info
stackblitz sveltekit latest https://stackblitz.com/edit/sveltejs-kit-template-default-9jjrby?file=src/routes/test/+page.server.js
Severity
annoyance
Additional Information
Thank you all for creating such a lovely product! I love SvelteKit!
The text was updated successfully, but these errors were encountered: