【发布时间】:2021-08-28 15:47:40
【问题描述】:
我对 React 打字非常陌生,我想问一下是否可以在 jsx 循环中添加 javascript?我一直在尝试很多方法,但似乎没有任何效果,所以我想看看是否有人有任何建议或想法。
{[...Array(7)].map((item,i) => (
//basically i want to add my "if" condition here but i am not sure about the syntax
<Tab id={"Item" + (number - i)} title={"Item " + (number - i )}></Tab>
))}
【问题讨论】:
标签: reactjs typescript jsx