Johnathon64
Johnathon64

Reputation: 1320

ReactJS not picking up css style

I am probably going about this the wrong way, but is it possible to add styles from and external CSS file within a a reactjs component? I have tried to do it the conventional way however this does not seem to work, where you reference the class or id within the external css and do all your styling there.

    var ProfilePanel = React.createClass({
  render: function() {
    return (
      <div>
        <p class="profile-text">{this.props.text}{this.props.children}</p>    
      </div>
    );
  }
});

and within my CSS I have:

    .profile-text{
        font-size: 10px;
    }

Upvotes: 1

Views: 1289

Answers (1)

HairLessDude
HairLessDude

Reputation: 289

You're using class which is reserved by js. You need to use className and should work.

Read more

Upvotes: 6

Related Questions