Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- class MyComponent extends React.Component {
- handleClick() {
- const { data } = this.state;
- this.setState({
- data: data + 1
- });
- }
- render() {
- return (
- <button onClick={this.handleClick.bind(this)}>
- Click me!
- </button>);
- }
- }
Add Comment
Please, Sign In to add comment