Is hydration required for SSR? #532
-
|
This may be a dumb question but if it isn't required, I can't get it to work. With only SSR, the HTML is provided as expected but there is no JS or WASM provided. They are not generated in the site root and therefore not provided to the browser. I guess my confusion may come from how hydration works. I see |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Not a dumb question at all. The way server-side rendering + hydration works is this:
|
Beta Was this translation helpful? Give feedback.
Not a dumb question at all. The way server-side rendering + hydration works is this:
ssrruns your app and "dehydrates" it by rendering it to HTML.hydratecallsmount_to_bodyand "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.