-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Milestone
Description
Since JSX is a global namespace, it is not possible to use typings declared in a module for its Element or ElementClass.
When writing a module, it would then be convenient to write something like ;
import {MyEltType, JSX} from 'my-custom-jsx-lib'
var myelt = <div> ...</div>and have typescript check Element, ElementClass and so on on its local JSX instance.
Also, when not providing any JSX namespace but having a factory that has a return type, the compiler crashes nastily with a
/usr/lib/node_modules/typescript/lib/tsc.js:33078
throw e;
^
TypeError: Cannot read property 'flags' of undefined
at isRelatedTo (/usr/lib/node_modules/typescript/lib/tsc.js:16013:32)
at checkTypeRelatedTo (/usr/lib/node_modules/typescript/lib/tsc.js:15941:26)
at checkTypeAssignableTo (/usr/lib/node_modules/typescript/lib/tsc.js:15819:20)
at isTypeAssignableTo (/usr/lib/node_modules/typescript/lib/tsc.js:15813:20)
at getJsxElementAttributesType (/usr/lib/node_modules/typescript/lib/tsc.js:18463:47)
at checkJsxOpeningLikeElement (/usr/lib/node_modules/typescript/lib/tsc.js:18564:40)
at checkJsxSelfClosingElement (/usr/lib/node_modules/typescript/lib/tsc.js:18265:13)
at checkExpressionWorker (/usr/lib/node_modules/typescript/lib/tsc.js:20439:28)
at checkExpression (/usr/lib/node_modules/typescript/lib/tsc.js:20349:42)
at checkExpressionCached (/usr/lib/node_modules/typescript/lib/tsc.js:20310:38)
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created