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

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

Closed
jakebailey opened this issue Jan 13, 2022 · 0 comments · Fixed by #47501
Closed
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@jakebailey
Copy link
Member

jakebailey commented Jan 13, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants