Skip to content

How to get Sveltekit to refresh the data when going from one [slug] to another? #9533

Answered by hubert-ix
hubert-ix asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, duh... I simply have to declare item with a reactive statement, otherwise sveltekit doesn't know it has changed...

+page.svelte

<script>
export let data;

$: item = data.item;
</script>

{item.title}

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@eallenOP
Comment options

@dangelomedinag
Comment options

@hubert-ix
Comment options

@eallenOP
Comment options

@sandrovilar
Comment options

Answer selected by hubert-ix
Comment options

You must be logged in to vote
2 replies
@eallenOP
Comment options

@ticup
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@fo-rk
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
8 participants