My question really simple you notice how I have a css variable here that is called frameStyle.
var Frame = React.createClass({
getInitialState: function() {
return {hover: false}
},
toggleHover: function(e) {
this.setState({
hover: !this.state.hover
})
},
render: function() {
if (this.state.hover){
linkStyle = "blue";
}else{
linkStyle = "red";
}
var frameStyle = {
width: 100,
height: 100,
backgroundColor: {this.props.linkStyle}
};
return (
<div onMouseEnter={this.toggleHover} onMouseLeave={this.toggleHover} style={frameStyle}>
</div>
);
}
});
How would I add something similar if I was to write a component using ES6? If someone could point to the right direction I would really appreciate it!