Skip to content

Proposal: JSX.ElementType #13890

Open
Open
@antanas-arvasevicius

Description

@antanas-arvasevicius

Hello,
There are many GUI frameworks (ExtJs, SmartClient, OpenUI5) which do not works in React way and they could be easily be integrated with JSX/TSX if their JSX expressions would return correct "element type" e.g.
const listGrid = <ListGrid/> ; // should be type of ListGrid or isc.IListgrid, not JSX.Element

My proposal would be to add new special type into global JSX namespace - ElementTypeProperty.

JSX.ElementTypeProperty

Given an element instance type, we need to produce a type that will be return type of that JSX element. We call this the element type.

The interface JSX.ElementTypeProperty defines this process.
It may have 0 properties, in which case element instance type will be element type.
Or 1 property, in which case the element type will be the type of that property type of element instance type.

Note: Intrinsic lookup is not affected by ElementTypeProperty.


Related: #13746

Metadata

Metadata

Assignees

Labels

Domain: JSX/TSXRelates to the JSX parser and emitterIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions