eclipsesource / eclipsesource/tabris-js

Add support for JSX Fragments

Open
#1,589 1 comment 2 reactions 0 assignees View on GitHub
api TypeScript/JSX
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.