title: how to bind in react functional component ? .bind(this) not working
body: <p>This is not getting bound in setTimeout, where I call setState function, why is this happening?</p>
  
  <p>I've added codepen bellow, I've tried same code in js, and it works </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta charset="UTF-8" /&gt;
  &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="root"&gt;&lt;/div&gt;
      &lt;script src="https://unpkg.com/react@16.3.1/umd/react.development.js"&gt;&lt;/script&gt;
      &lt;script src="https://unpkg.com/react-dom@16.3.1/umd/react-dom.development.js"&gt;&lt;/script&gt;
      &lt;script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/babel"&gt;
        const state = { 
          eventCount: 0,
        }
  
        function setState(newState) {
          Object.assign(state, newState);
          render();
        }
  
        setTimeout(
          function() {
            this.setState({eventCount: 666});
          }
          .bind(this),
          1000
        );
  
  
  
        function App() {
          return (
            &lt;div&gt;
              &lt;p&gt;
                There have been {state.eventCount} events.
              &lt;/p&gt;
            &lt;/div&gt;
          )
        }
  
  
        function render() {
          ReactDOM.render(&lt;App/&gt;, document.getElementById('root'));
        }
        render();
  
  
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><a href="https://codepen.io/anon/pen/gZgQWX?editors=1011" rel="nofollow noreferrer">https://codepen.io/anon/pen/gZgQWX?editors=1011</a> (react)
  <a href="https://codepen.io/anon/pen/oJZerP?editors=1111" rel="nofollow noreferrer">https://codepen.io/anon/pen/oJZerP?editors=1111</a> (js example )</p>