title: Change state in forEach loop
body: <p>How can I change state on click event on the buttons? Now I have error</p>
  
  <p><strong>Uncaught TypeError: this.setState is not a function</strong></p>
  
  <p>I know that I can't use here <strong>this.setState</strong> but I can't understand where should I make bind      </p>
  
  <pre><code>class Popup extends React.Component {
    constructor(props){
      super(props);
      this.state = {opened: false};
    }
  
    componentDidMount(){
      var popupOpenBtn = document.querySelectorAll('[data-popup]');
  
      popupOpenBtn.forEach(function(item) {
        item.addEventListener("click", function(){
          this.setState({
            opened: true
          });
        })
      });
    }
  </code></pre>