Skip to content

support Fragments #9

Closed
Closed
@mgeorgehansen

Description

@mgeorgehansen

React and Preact both have "Fragment" components, which don't render any wrapper tags but simply delegate rendering to their children. This makes components more composable in contexts where tags have a nesting context (e.g. <li> must be a direct descendant of a <ol> or <ul>).

Unfortunately the TypeScript compiler does not support a custom pragma for React's <></> fragment syntax yet, though this is on track for release soon (see microsoft/TypeScript#38720), but we can provide a Fragment component in the meantime e.g. <Fragment><li>1</li></Fragment>.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions