Reputation: 1320
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
Reputation: 289
You're using class
which is reserved by js. You need to use className
and should work.
Upvotes: 6