有this old chat建议编写您自己的片段包装器,但我理解该片段现在应该被本机支持。然而,我无法快速找到它的正确语法。
我正在寻找的示例:
<fragment>
<button label="foo"/>
<button label="bar"/>
</fragment>发布于 2019-06-03 21:29:44
这是官方的documentation page on reason-react and fragments。
在reason-react中使用React片段的语法如下:
<>
<button label="foo"/>
<button label="bar"/>
</>如果您正在努力寻找像<Fragment>这样的东西(这就是我的经历),那么这种简洁的语法可能很容易被忽略。我首先在release notes for version 0.5.0中找到了答案
https://stackoverflow.com/questions/56428421
复制相似问题