【发布时间】:2020-12-01 00:03:58
【问题描述】:
我必须为片段设置一个属性。我想做这样的事情:
<className="name">
abcd
</>
有没有办法做到这一点?
【问题讨论】:
-
"You can use
<></>the same way you’d use any other element except that it doesn’t support keys or attributes." 即使使用非速记语法,对于同一页面,片段也仅支持key属性。 -
感谢您的回答 jonrsharpe!
标签: reactjs jsx react-fragment