I get objects from api , i get it and mapping over it and return <p></p> like this:
data.map((item) => <p> {item.p} </p> )
my question is: how can i give every paragraph a diffrent backgrounColor from each other?
>Solution :
You can make different colors for each element in the following way
data.map((item) => <p style={{ backgroundColor: `#${((Math.random() * 0xfffff * 1000000).toString(16)(.slice(0,6)}` }}> {item.p} </p> )