Skip to content

Commit 97185eb

Browse files
docs Update 03-typescript.md (#14382)
* Update 03-typescript.md Fix TS error: Cannot invoke an object which is possibly 'undefined'. * Update 03-typescript.md --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 520055c commit 97185eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

documentation/docs/07-misc/03-typescript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ In case you're writing a component that wraps a native element, you may want to
142142
</script>
143143
144144
<button {...rest}>
145-
{@render children()}
145+
{@render children?.()}
146146
</button>
147147
```
148148

@@ -156,7 +156,7 @@ Not all elements have a dedicated type definition. For those without one, use `S
156156
</script>
157157
158158
<div {...rest}>
159-
{@render children()}
159+
{@render children?.()}
160160
</div>
161161
```
162162

0 commit comments

Comments
 (0)