渲染元素React

时间:2018-08-07 09:04:44

标签: reactjs

我有一个按地图渲染的数组。当我单击标签时我想要 渲染<ExamplesResultComponent>,但是此渲染在地图的所有元素中如何解决?

return(
    data.map((element) =>

      <div className="table-element-block" >
        <div  className="table-element"><span className="table-element-content">{element.category}</span></div>
        <div  className="table-element"><span className="table-element-content">{element.input}</span></div>

        <div  className="table-element" onClick={() => this.play(element.audio)}>
        <label>
          <i className="material-icons microphone-i" >
            <PlayArrow ></PlayArrow></i>
        </label>
        </div>

        <div  className="table-element">
          <label onClick={() => getData(element.input,element.audio,true)} className="draw meet animation-border  mdl-button mdl-js-button mdl-button--icon mdl-button--file score-modified">
          <i className="material-icons microphone-i" />
          Score!
          </label>
        </div>
          this.renderEx();
        <hr className="hr"/>
      </div>
    )
)

0 个答案:

没有答案