Svelte · Middle · Question 27 of 75
How do you mount a Svelte 5 component into the page manually?
import { mount } from "svelte";
import App from "./App.svelte";
const app = mount(App, { target: document.getElementById("app"), props: { name: "Ann" } });- ✓Correct answer: With
mount(Component, { target, props });unmountremoves it - 2With
new App({ target })only - 3With
ReactDOM.render
Explanation
new Component() was the Svelte 4 API. For server-rendered HTML use hydrate instead of mount.