score:0

Accepted answer
if(this.state.items){
  const itemList = this.state.items.map((item, index) => (
    <li key={index}> {item} </li>
  )
}

score:0

const itemList = (this.state.items && this.state.items.length > 0) ?
this.state.items.map(
    (item, index) =>
    <
    li key = {
        index
    } > {
        item
    } <
    /li>
) : ''

Related Query

More Query from same tag