## State in the Classy World

    import React from "react";

    class Counter extends React.Component {
      state = {
        counter: 0
      };

      render() {
        return (
          <>
            <div>Clicks: {this.state.counter}</div>
            <button
              onClick={() =>
                this.setState(state => ({ counter: state.counter + 1 }))
              }
            >
              Increment
            </button>
          </>
        );
      }
    }

    export default Counter;