Skip to content

Commit

Permalink
Update wording to include prop behaviour
Browse files Browse the repository at this point in the history
In regards to sveltejs#4442, this adds wording to explain that props are set to undefined when they are removed by the consumer.
  • Loading branch information
jesseskinner committed Feb 27, 2020
1 parent 042b731 commit 8897174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/content/docs/01-component-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Svelte uses the `export` keyword to mark a variable declaration as a *property*

---

You can specify a default value, which will be used if the component's consumer doesn't specify a prop.
You can specify a default value for a prop. It will be used if the component's consumer doesn't specify the prop on the component. Note that whenever a specified prop is removed by the consumer, the value is set to `undefined` rather than the default value.

In development mode (see the [compiler options](docs#svelte_compile)), a warning will be printed if no default is provided and the consumer does not specify a value. To squelch this warning, ensure that a default is specified, even if it is `undefined`.

Expand Down

0 comments on commit 8897174

Please sign in to comment.