-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
DiscussionIssues which may not have code impactIssues which may not have code impact
Description
I find this to be very limiting:
export namespace JSX {
export interface Element {
}
export interface IntrinsicElements {
div: {};
}
}
let a = <div></div>;tsc test.tsx --jsx react --noImplicitAny
test.tsx(2,18): error TS1148: Cannot compile modules unless the '--module' flag is provided.
test.tsx(12,9): error TS2602: JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist.
test.tsx(12,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists
test.tsx(12,10): error TS2304: Cannot find name 'React'.
It doesn't complain if I remove the export keyword. Why does it need to rely on a global type? Can't it not be local? I want to develop a JSX framework and I want to create a local type of JSX.Element etc. and then compile the definition file. I did began with declaring JSX.Element in a d.ts file, but there was some limitation with that approach. Also all my modules is of external type.
morrisallison
Metadata
Metadata
Assignees
Labels
DiscussionIssues which may not have code impactIssues which may not have code impact