You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default the result of a JSX expression is typed as any. You can customize the type by specifying the JSX.Element interface. However, it is not possible to retrieve type information about the element, attributes or children of the JSX from this interface. It is a black box.
This proposal is to somehow allow specifying types so that it can be decided by tsc:
conststatus=<pclass='status'/>;// type = HTMLParagraphElement
@MartinJohns I don't think so... I think I just got it working a few minutes ago with JSX.ElementType but I can't repro. But if I can, then this is already solved...
π Search Terms
JSX IntrinsicElements Element
β Viability Checklist
β Suggestion
The docs currently say:
This proposal is to somehow allow specifying types so that it can be decided by tsc:
π Motivating Example
The examples on https://vanillajsx.com/ all have assertions like
as HTMLParagraphElement
.This change would enable custom JSX libraries easier to specify that
"p": HTMLParagraphElement
to avoid this.π» Use Cases
Iterate on experimental JSX implementations.
Explicitly asserting JSX element types.
Explicitly asserting JSX element types.
The text was updated successfully, but these errors were encountered: