From 9375dac6e78cd8d96c5ed6fe79e9ee31d10fd849 Mon Sep 17 00:00:00 2001 From: Dave Snider Date: Fri, 31 Jan 2025 10:38:35 -0500 Subject: [PATCH] Snippet typing docs should show the type --- .../docs/03-template-syntax/06-snippet.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/documentation/docs/03-template-syntax/06-snippet.md b/documentation/docs/03-template-syntax/06-snippet.md index c9951d3f3414..672fe36ff899 100644 --- a/documentation/docs/03-template-syntax/06-snippet.md +++ b/documentation/docs/03-template-syntax/06-snippet.md @@ -228,22 +228,29 @@ Snippets implement the `Snippet` interface imported from `'svelte'`: With this change, red squigglies will appear if you try and use the component without providing a `data` prop and a `row` snippet. Notice that the type argument provided to `Snippet` is a tuple, since snippets can have multiple parameters. -We can tighten things up further by declaring a generic, so that `data` and `row` refer to the same type: +We can tighten things up further by declaring a Fruit type, so that `data` and `row` refer to the same type. Now a row snippet will error if the shape is not used. ```svelte - + ``` ## Exporting snippets