Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- class App extends Component {
- constructor(props) {
- super(props);
- this.state = {counter: 0};
- }
- CenterButtonClickEvent(e){
- this.setState((prevState, props) => ({
- counter: prevState.counter + 1
- }))
- }
- render() {
- return (
- <div>
- <button style={{"width" : "100%", "height": "97vh"}} onClick={this.CenterButtonClickEvent.bind(this)}>{this.state.counter}</button>
- </div>
- );
- }
- }
- export default App;
Add Comment
Please, Sign In to add comment