Skip to content

SSR + Hydration #411

Answered by lukechu10
norman784 asked this question in Q&A
Apr 19, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

I was thinking of something more like the latter. In that case, the data would be fetched on the server, serialized into some JSON payload which could be inlined in the html and then deserialized and put into a context (https://sycamore-rs.netlify.app/docs/advanced/contexts) when the app is mounted. That way, the data is only fetched once on the server and not on the client.

The problem with this is that it should also work well with the router so that when navigation occurs, the data is fetched on the client since nothing is being rendered on the server.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@norman784
Comment options

Answer selected by norman784
Comment options

You must be logged in to vote
1 reply
@norman784
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
3 participants