acurth
4/20/2018 - 12:45 AM

state syntax

class TodayImFeeling extends React.Component {
  constructor(props) {
    super(props);
    this.state = { mood: 'decent' };
  }

  render() {
    return (
      <h1>
        I'm feeling {this.state.mood}!
      </h1>
    );
  }
}

//BINDING:
class Random extends React.Component {
  constructor(props) {
    super(props);
    this.state = { color: [200, 15, 30] }
    this.handleClick = this.handleClick.bind(this);
  }