{"size": 509, "ext": "js", "max_stars_repo_path": "src/components/Toggle.js", "max_stars_repo_name": "galenmontague/gm-react-widgets", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Toggle.js", "max_issues_repo_name": "galenmontague/gm-react-widgets", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Toggle.js", "max_forks_repo_name": "galenmontague/gm-react-widgets", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.5769230769, "max_line_length": 75, "alphanum_fraction": 0.5776031434}
import React, { Component } from "react";

export default class Toggle extends Component {
  constructor(props) {
    super(props);

    this.state = {
      isToggleOn: true
    };
  }

  handleClick = () => {
    this.setState({ isToggleOn: !this.state.isToggleOn });
    console.log("clicked");
  };

  render() {
    return (
      <div>
        <h1>{this.state.isToggleOn ? "Hello!" : "Goodbye!"}</h1>
        <button onClick={this.handleClick}>Click to Toggle Message</button>
      </div>
    );
  }
}
