0
<div className="feedback">
{(this.state.finished) ? questions.map(function(x, index) { return
<div>
</div>
}) : null}
</div>
所以我現在有上面的代碼。我想在另一塊的js代碼this.state.score
而不是內部的地圖功能添加這樣的,因爲我只希望它渲染一次(目前它呈現每次映射陣列上的時間)如何正確渲染jsx
<div className="feedback">
{(this.state.finished) ? {this.state.score} //WANT TO ADD IT HERE questions.map(function(x, index) { return
<div>
</div>
}) : null}
</div>
,但是這並未」工作。所以我怎麼在這裏添加我的代碼?我也需要它在三元內