Skip to content
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

Add SvelteKit SSR example to README #32

Merged
merged 2 commits into from
Feb 8, 2022
Merged

Conversation

khromov
Copy link
Contributor

@khromov khromov commented Jan 30, 2022

Turns out it's super easy and convenient to combine sswr with server-side fetching in SvelteKit!

@ConsoleTVs ConsoleTVs merged commit 499fccb into ConsoleTVs:master Feb 8, 2022
@ConsoleTVs
Copy link
Owner

Why is all the fuzz needed? Wound't just passing down the prop from server and then using it in initialData do the trick already?

@khromov
Copy link
Contributor Author

khromov commented Feb 8, 2022

@ConsoleTVs Thanks for the merge. I tried only setting initialData, but it still wouldn't render the data in the HTML, so there was a "flash of no data" when loading the page.

It's probable this could be fixed with some SvelteKit-specific integration point in sswr.

@ConsoleTVs
Copy link
Owner

@khromov I have updated your SSR example. Please check it out and let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants