title: How can I bind function with hooks in React?
body: <p>Basically we bind event handler functions in constructor or make them as arrow functions in React class components like below</p>
  
  <pre><code>class Test extends Component{
    constructor(props){
      super(props);
      this.state = { count:0 };
      this.setCount = this.setCount.bind(this);
    }
  
    setCount() {
      this.setState({count: this.state.count + 1});
    }
  
    render() {
      return &lt;button onClick={this.setCount}&gt;Increase&lt;/button&gt;
    }
  }
  </code></pre>
  
  <p>But after hooks are introduced in React v16.7.0 the class components became functional components with state.</p>
  
  <p>So how can I bind the function with hooks in functional component?</p>