Passing Props from Parent
Provide values to child component props in the parent template.
Import the Child
Use a standard ES import at the top of the parent to bring in the child component.
<script>
import Greeting from "./Greeting.svelte";
</script>Use the Tag
Render the child by writing a tag with its capitalized name.
<Greeting />All lessons in this course
- Declaring Props with export let
- Passing Props from Parent
- Default Prop Values
- Forwarding Props with $$props and $$restProps