Solution for "bind in react functional component"

class Foo extends Component { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } handleClick() { console.log('Click happened'); } render() { return <button onClick={this.handleClick}>Click Me</button>; } }

react bind function to component

Similar codes for "bind in react functional component"


Latest 'Javascript' questions

Added before "bind in react functional component"