Svelte · Junior · Question 28 of 76
How do you use one component inside another?
<script>
import Button from "./Button.svelte";
</script>
<Button label="Save" />- ✓Correct answer: Import it and use it as a tag with a capitalized name
- 2Register it globally with
app.component() - 3Wrap it in
<svelte:component>every time
Explanation
Component names start with a capital letter so the compiler can tell them from HTML elements.