For now the component and JSX related type aliases are like:
/**
* Component type aliases.
*/
type Component = (props: JsxProps) => Renderable;
type Renderable = JsxNode | NestedArray<JsxNode>;
/**
* JSX type aliases.
*/
type JsxNode = JsxElement | string;
type JsxElement = { tag: string | Component; props: JsxProps };
type JsxAttrs = { [key: string | symbol]: any };
type JsxProps = JsxAttrs & { children: Array<JsxNode> };
The problem is that the returned type of a component is complicated, which makes the later process of JSX/Fiber/DOM elements complicated, too. If the types of a component could be simpler, it may help a lot.
Also, the fragment should be considered, too.
For now the component and JSX related type aliases are like:
The problem is that the returned type of a component is complicated, which makes the later process of JSX/Fiber/DOM elements complicated, too. If the types of a component could be simpler, it may help a lot.
Also, the fragment should be considered, too.