Skip to content

Support TypeScript generics on snippets #15883

Open
@WarningImHack3r

Description

@WarningImHack3r

Describe the problem

I just noticed it's not possible to use generics in a raw snippet declaration:

{#snippet mySnippet<T extends { prop: string }>(item: T)}
    <div>{item.prop}</div>
{/snippet}

Is it intentional? Is such a feature expected to be supported in the future? Snippets passed as props do support generics, so I think this should be added, in my opinion.

Describe the proposed solution

Add full TypeScript support for snippets in the markup

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions