I'm successfully pulling in JSON data and mapping it within a React component. However, one of the values in the JSON is a HEX code that I want to apply as an inline style for the background color of a div
.
I have experimented with various methods, but my attempt was like this:
<div className="ribbon-wrapper">
<div className="ribbon" style={{backgroundColor: {item.color.tint}}}></div>
</div>
This results in a
Syntax error: Unexpected token, expected ,
. Is there a more effective way to achieve this?