In react, have this:
return (
   <tag>
     { variable ? 
            <p> hello </p>
        :
            <p> world </p>
     }
   </tag>
)
As you can see, I am doing a ternary operator to output content depending on variable. I want to add style attribute in the p tag, like this:
<p style="color:#DF0101;font-weight:bold;"> hello </p>
But it doesn't work. I also tried:
<p style={{color:"#DF0101", font-weight:"bold"}}>
What am I doing wrong?
 
     
     
    