score:0

const  App = () => {
  const array = [
    {
      title: 'news1',
      content: 'brabrabrabra1',
      color: 'red'
    },
    {
      title: 'news2',
      content: 'brabrabrabra2',
      color: 'blue'
    },
    {
      title: 'news3',
      content: 'brabrabrabra3'
      color: 'green'
    }
  ]
  return (
      <>
      {array.map((item, i) => (<InfoTitle style={{backgroundColor: item.color}} key={i}>{item.title}</InfoTitle>))}
      </>
  )

}

Related Query

More Query from same tag