Svelte · Senior · Question 19 of 75
How does Svelte render on the server?
import { render } from "svelte/server";
const { head, body } = render(App, { props: { user } });- ✓Correct answer:
renderproduces HTML strings; in the browserhydrateattaches to that HTML instead of re-creating it - 2The browser renders and sends HTML back to the server
- 3SSR requires SvelteKit
Explanation
Effects and onMount don't run on the server. Code in <script> runs in both places, so it must be safe without window.