Skip to content

Is hydration required for SSR? #532

Answered by gbj
SteveCookTU asked this question in Q&A
Discussion options

You must be logged in to vote

Not a dumb question at all. The way server-side rendering + hydration works is this:

  1. On the server, code compiled to your native target with feature ssr runs your app and "dehydrates" it by rendering it to HTML.
  2. In the browser, code compiled to WebAssembly with feature hydrate calls mount_to_body and "rehydrates" it by adding event listeners and interactivity. (This is where the term "hydrate" comes from.) This basically walks over the tree of your application's view, picking up the nodes that were already rendered to HTML on the server and adding interactivity.

Replies: 1 comment 1 reply

Comment options

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

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