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 摘要。