@ -43,11 +43,51 @@ You can specify a fallback value for a prop. It will be used if the component's
<Nestedanswer={42}/><!-- answer is set to 42 -->
<Nestedanswer={null}/><!-- answer is set to null (default value is not used)-->
<Nested/><!-- answer is set to default value-->
<Nestedanswer={undefined}/><!-- answer is set to default value-->
<Nested/><!-- answer is set 3 (default value)-->
<Nestedanswer={undefined}/><!-- answer is set 3 (default value)-->
```
Deep nesting refers to having components nested within other components across multiple levels. In this setup, props can be passed from parent to child components through several layers.
@ -177,24 +177,30 @@ A JavaScript expression can be included as text by surrounding it with curly bra
{expression}
```
When using {expression} inside markup, Svelte automatically converts the value to a string before rendering it. The conversion follows JavaScript's standard behavior:
When using {expression} inside markup, Svelte automatically converts the value to a string before rendering it and makes the expression reactive (similar to wrapping it in $derived). The conversion follows JavaScript's standard behavior:
- Primitive values (number, boolean, string) are directly converted to strings.
- Objects call their .toString() method (if not overridden, it defaults to [object Object]).
- undefined and null are treated as empty strings ("").
- Undefined and null are treated as empty strings ("").
- Expressions using runes ($state, $derived, etc.) maintain their specific reactive behavior.
Curly braces can be included in a Svelte template by using their [HTML entity](https://developer.mozilla.org/docs/Glossary/Entity) strings: `{`, `{`, or `{` for `{` and `}`, `}`, or `}` for `}`.