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 } });

Explanation

Effects and onMount don't run on the server. Code in <script> runs in both places, so it must be safe without window.

Further reading

Problem with a question

Svelte · Senior · question 19

Test yourself

Take the Svelte · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz