-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Milestone
Description
TypeScript Version: 4.1.2
Search Terms:
no interface JSX.IntrinsicElements exists
Code
This works:
namespace JSX {
export interface IntrinsicElements {
div: {[k: string]: any}
}
}
const d = <div /> // <-- no error
type test = JSX.IntrinsicElements // <-- no errorBut this does not work:
import type {JSX} from 'solid-js'
const d = <div /> // Error: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
// But JSX is in scope, just that JSX expressions do not see it.
// As an example, the following non-JSX code works fine:
type test = JSX.IntrinsicElements // <-- no errorExpected behavior:
It should see the definition of JSX.IntrinsicElements which is clearly present due to the import statement.
Actual behavior:
The JSX definition in the second example (imported) appears to be invisible to TS.
As you can see from both examples, only a locally-defined JSX works, but not one that is imported.
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug