eclipsesource / eclipsesource/tabris-js
Add support for JSX Fragments
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Description
Currently the shortest syntax is to add multiple JSX elements in one `append` call is to use commas:
```jsx
ui.contentView.append(
,
);
```
Very ugly. The alternative is to use WidgetCollection:
```jsx
ui.contentView.append(
);
```
However, this is much longer. In React there is also the fragment element, which would make it look like this:
```jsx
ui.contentView.append(
<>
);
```
TypeScript added support for this syntax in 2.7, but it does not work in Tabris.js because we use the `jsxFactory` compiler option. This is a limitation that may be eliminated in the near future: https://github.com/Microsoft/TypeScript/issues/20469
Once fragments work with `jsxFactory` we should support it.
Contributor guide
Assessment
This issue has not been assessed yet.