developit / developit/htm

Shouldn’t multiple root elements become a fragment?

Open
#175 8 comments 7 reactions 0 assignees View on GitHub
discussion has fix question
Dominant language
JavaScript
Stars
9k
Forks
181
PR merge metrics
No merged PRs in 30d

Description

This works for me:

```js
return html`
<${React.Fragment}>

Quiz


${entriesUi}


<${Summary} entries=${entries} />

`;
```

If I don’t wrap the fragment around the roots, I’m getting this error:

> Warning: Each child in a list should have a unique "key" prop.

(That is, HTM seems to return an Array and not a fragment.)

If my suggestion doesn’t make sense, then it may be helpful to support the `<>...` syntax for fragments.

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.