I would want to use the this.props data in the div tag. i have the color in the data which i would want to set dynamically . Would it be possible to use this.props in the div tag?
var cont = {
height: "90px",
width: "20%",
background: "LightBlue",
display: "inline-block",
padding: "5px",
margin: "5px"
};
var Comment = React.createClass({
render: function () {
return (
<div style={cont}>
<span>
{this.props.author}
{this.props.col}
</span>
</div>
);
}
});
Try this:
Offical React style documentation