daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ButtonComponent extends React.Component {
  2.   constructor(props) {
  3.     super(props)
  4.     this.state = {
  5.       message: 'I do not need to be manually binded!',
  6.     }
  7.   }
  8.  
  9.   // this is now defined using the arrow function syntax
  10.   handleClick = () => {
  11.     console.log(this.state.message)
  12.   }
  13.  
  14.   render() {
  15.     return
  16.       < button onClick={this.handleClick} />
  17.   }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top