Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add a note on typing Snippets in $props #15691

Open
Lofty-Brambles opened this issue Apr 5, 2025 · 1 comment
Open

doc: add a note on typing Snippets in $props #15691

Lofty-Brambles opened this issue Apr 5, 2025 · 1 comment

Comments

@Lofty-Brambles
Copy link

Describe the problem

When trying to type $props, a common requirement tends to be providing a type to children. To a complete svelte newbie, it might be helpful to let them know that it is a snippet. Would it be pertinent to have a note linking to the typing snippets section inside the documentation for $props for that? Somewhere around/below the type safety section?

Describe the proposed solution

Something along the lines of:

[!NOTE] It is quite common to provide a type for children. children is typed as a Snippet, an section on providing types for Snippets is provided here.

Importance

nice to have

@Lofty-Brambles
Copy link
Author

I'm open to dropping a small PR if this is okay-ed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant