score:1

Accepted answer

This answer might not be perfect but you can do it like so.

{this.state.data.map(item => { 
 if (item.period === 'YTD') {
    Return <div>{item.gross}</div>
   }

This is an example of Using map to reformat objects in an array

Like Mozilla https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map


Related Query

More Query from same tag