Skip to content

TSX: Property does not exist on type 'JSX.IntrinsicElements' #15449

Closed
@iffy

Description

@iffy

TypeScript Version: 2.3.1

Code

import * as React from 'react';

declare namespace JSX {
    interface IntrinsicElements {
        'heyo': any
    }
}

let Something = React.createClass({
    render: function() {
        return (<div><heyo>foo</heyo></div>);
    }
})

Expected behavior:

I expect it to compile without error.

Actual behavior:

Running this command:

tsc --jsx react --module "amd" --target es2017 test.tsx 

I get this output:

test.tsx(11,22): error TS2339: Property 'heyo' does not exist on type 'JSX.IntrinsicElements'.
test.tsx(11,31): error TS2339: Property 'heyo' does not exist on type 'JSX.IntrinsicElements'.

I got the declare statement from #4648

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions