Skip to content

JSX attribute completions sometimes don't work when tag type arguments are specified #47416

Closed
@jakebailey

Description

@jakebailey

In the below example, completing after GenericElement<number> in f1 doesn't work (no xyz), but in f2, it does. Note that this is not new and is unrelated to snippets (so my other PRs for JSX snippets don't change anything, we just found it in testing).

declare const React: any;

namespace JSX {
    export interface IntrinsicElements {
        div: any;
    }
}

function GenericElement<T>(props: {xyz: T}) {
    return <></>
}

function fn1() {
    return <div>
        <GenericElement<number> />
    </div>
}

function fn2() {
    return <>
        <GenericElement<number> />
    </>
}

Playground Link: Provided

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions