Skip to content
Discussion options

You must be logged in to vote

If you use $page.data, you dont get type completion of your load function in the editor

But you do if you use export let data: PageData in your +page.svelte file, you do

Its a convenience for us, the developers, functionally.. there is not much difference between the 2. $page is a store, so it can be called deep inside components without prop drilling, so generally to make your life easier, use $page when you are in components, and export let data:PageData when you are in a +page.svelte file.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by hanszoons
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@david-plugge
Comment options

@charisra
Comment options

@cdcarson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants