Iterating over JSON in React

前端 未结 4 968
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-14 21:22

I have following code:

export class Highlights extends React.Component {
    render() {
        return (
            
{JSON.string
4条回答
  •  难免孤独
    2020-12-14 22:15

    {this.props.highlights_data.data.map((e, i) => )}

    You could just send in the item itself.

    
    

    And access label and value in the child with props.item.label or props.item.value.

提交回复
热议问题