Guest User

Untitled

a guest
Oct 19th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import React from 'react';
  2. class MyComponent extends React.Component {
  3. handleClick() {
  4. const { data } = this.state;
  5. this.setState({
  6. data: data + 1
  7. });
  8. }
  9. render() {
  10. return (
  11. <button onClick={this.handleClick.bind(this)}>
  12. Click me!
  13. </button>);
  14. }
  15. }
Add Comment
Please, Sign In to add comment