score:1

Accepted answer
return values.map(value => {
  const Tag = `h${head ? 'th' : 'td'}`;
  return <Tag key={uuidv4()}>{value}</Tag>
});

score:1

return values.map(value => {
    return head ? <th key={uuidv4()}> {value} </th> :
                  <td key={uuidv4()}> {value} </td>
});

Related Query

More Query from same tag