Skip to content

Commit 98a55e4

Browse files
docs: mention that snippets can only be called through @render
1 parent 32ee6c1 commit 98a55e4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

documentation/docs/03-template-syntax/06-snippet.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Snippets, and [render tags](@render), are a way to create reusable chunks of mar
5555

5656
Like function declarations, snippets can have an arbitrary number of parameters, which can have default values, and you can destructure each parameter. You cannot use rest parameters, however.
5757

58+
> [!NOTE] Unlike function declarations, you can only call a snippet through the [`{@render ...}`](@render) tag.
59+
5860
## Snippet scope
5961

6062
Snippets can be declared anywhere inside your component. They can reference values declared outside themselves, for example in the `<script>` tag or in `{#each ...}` blocks ([demo](/playground/untitled#H4sIAAAAAAAAE12P0QrCMAxFfyWrwhSEvc8p-h1OcG5RC10bmkyQ0n-3HQPBx3vCPUmCemiDrOpLULYbUdXqTKR2Sj6UA7_RCKbMbvJ9Jg33XpMcW9uKQYEAIzJ3T4QD3LSUDE-PnYA4YET4uOkGMc3W5B3xZrtvbVP9HDas2GqiZHqhMW6Tr9jGbG_oOCMImcUCwrIpFk1FqRyqpRpn0cmjHdAvnrIzuscyq_4nd3dPPD01ukE_NA6qFj9hvMYvGjJADw8BAAA=))...

0 commit comments

Comments
 (0)