-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Allow the use of a module JSX namespace #8757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Regarding the first point, you can now do this using the I'll take a look at the crash |
By doing declare global {
namespace JSX {
}
} I get an Is there something I'm not seeing ? |
Does this mean I have to have a If so, would that mean that I would be limited to extending the JSX.Element, rather than define it altogether ? |
That error and restriction has been removed |
Should I use a nightly build then ? By the way I have tried to make a simple reproduction for the mentioned bug, but couldn't. The library that explodes as such is on github and I'd be delighted to show you how to reproduce if you wish. |
Yea, the nightly build should make that error go away. A github repo for the bug would be great, always happy to look at those. |
I just tested with [email protected] and the crash is no longer present. There is a way of reproducing with 1.8.10 (I started a branch for this), are you still interested or do you consider this as resolved ? |
If it's fixed in the nightly then it's probably a duplicate of #7286 |
Since everything is working fine for me, shouldn't we mark this as closed ? |
We have a large extensible application where different extension authors might use different virtual dom libraries underneath TSX. Right now because |
@ellisonbg please see #15386 |
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 ;
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
The text was updated successfully, but these errors were encountered: