title: Change boolean value with handleClick in React.js
body: <p>I'm working on a small component which is essentially a button that allows a user to click to see a small shopping cart overlay. </p>
  
  <p>If "showCart" is false (AKA the button is not clicked), the cart should be invisible. If the button is clicked, "showCart" should become true and thus render the  component.</p>
  
  <p>I try clicking on the button and while I do get my console.log message "Button clicked", my Cart overlay doesn't appear. Can anyone give me some insight as to why this isn't working?</p>
  
  <pre><code>class ViewCart extends React.Component {
    constructor(props) {
      super(props);
      this.state = { showCart: false }
      this.handleClick = this.handleClick.bind(this);
    }
  
    handleClick() {
      this.setState ={ showCart: true} 
      console.log("button clicked")
  
    }
    render() { 
      return (
        &lt;div&gt; 
        &lt;button onClick={this.handleClick}&gt; Show Cart 
          {this.state.showCart ? &lt;Cart /&gt;: null }
          &lt;/button&gt;
  
          &lt;/div&gt;
          );
    }
  }
  </code></pre>