Components can pass and receive props to and from other components with exported let
variables.
Default values can be set by assigning the variable.
Components can be imported to use in other components.
Components are rendered using PascalCase.
Components are reusable building blocks of a user interface. Svelte components are created in files with a .svelte
extension.
In this example, we'll create a Todo
component that accepts task
and checked
props. We'll then render it in a TodoList
component.
Components can pass and receive props to and from other components with exported let
variables.
Default values can be set by assigning the variable.
Components can be imported to use in other components.
Components are rendered using PascalCase.
Data & its shorthand notation can also be used for props.
Multiple props can be passed at once with the spread operator ...
.
Further reading on this topic.