menu
TSX
Tag based trees are pretty useful and broadly applicable.
TSX
tag based trees are pretty useful and broadly applicable
full TSX support (no arbitrary XMLNS namespaces though)
there are other ways of doing UI, but this is a pretty good one, and it's very familiar
trees, generalised tree litearls,
lowercase tree builders, ..?
support both "Elements" (like
<Panel />) and "fragments" (<div />)(unfortunately this also means keeping TS ambiguity around..)
contextual TreeBuilder interface incl. string tags
tree literals build through a contextual
TreeBuilderotherwisecompiler.treenames the default builder as<specifier>#<export>lowercase tags are keys of the builder's
Tagsrow and call its staticelement; fragments call its staticfragmentuppercase tags resolve ordinary lexical values: functions receive a props object, classes receive constructor props, and structs receive literal fields
written and spread attributes merge under TSX rules; every required property must be present and every contributed property must exist on the target row
children synthesize the
childrenproperty and form a source-ordered tupletext remains a string literal and spread children must have statically known tuple length
1export function Greeting({ name }: { name: string }) {2 return <h1>Hello, {name}!</h1>;3}