Skip to content

Checking JSX elements ignores JSX.IntrinsicElements declared using template literal index signaturesΒ #55240

Closed
@Andarist

Description

@Andarist

Bug Report

πŸ”Ž Search Terms

JSX IntrinsicElements template literal types index signatures

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

declare const React: unknown

declare namespace JSX {
    export interface IntrinsicElements {
        [elemName: `test${string}`]: {}
    }
}

;<testfoo /> // Property 'testfoo' does not exist on type 'JSX.IntrinsicElements'.(2339)

πŸ™ Actual behavior

An error is reported claiming that testfoo does not exist on type JSX.IntrinsicElements

πŸ™‚ Expected behavior

I'd expect that index signature to permit this JSX element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Possible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some cases

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions