I am trying to add inline style to the element using reactjs. I found
var divStyle = {
color: 'white',
backgroundImage: 'url(' + imgUrl + ')'
};
ReactDOM.render(<div style={divStyle}>Hello World!</div>, mountNode);
in reactjs docs. Thing is, it is not working without JSX.
I tried doing this.
return (
React.DOM.div({ className: 'eventsOuter'},
{style:'divStyle'}
)
But the style part is not working.
Is there any way to fix this?