dcsan / maodou

1 stars 5 forks source link

inline styles with react #2

Open dcsan opened 9 years ago

dcsan commented 9 years ago

http://stackoverflow.com/questions/27530462/react-jsx-style-tag-error-on-render

var styles = {
  color:"red";
}

return (
  <div>
    <p style={styles}>something</p>
  </div>    
)
dcsan commented 9 years ago

or @limingth way:

<p style={{color:'red'}}>Player Name: {this.props.myname}</p>