developit / developit/htm

Shouldn’t multiple root elements become a fragment?

未关闭
#175 8 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看
discussion has fix question
主要语言
JavaScript
星标
9k
派生
181
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。