Skip to content

Instantly share code, notes, and snippets.

@sajithdilshan
Created January 27, 2018 19:35
Show Gist options
  • Save sajithdilshan/4bee6255ad251cd96c53a889c840d519 to your computer and use it in GitHub Desktop.
Save sajithdilshan/4bee6255ad251cd96c53a889c840d519 to your computer and use it in GitHub Desktop.
import React from "react";
export default class ColorComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
color: "lightgrey"
}
}
render() {
return (
<div className="color-container" style={{backgroundColor: this.state.color}}/>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment