<div id="root"></div>
@import url(https://fonts.googleapis.com/css?family=Open+Sans);

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
button {
  vertical-align: middle;
  border-radius: 5px;
  padding: 15px 25px;
  font-size: 22px;
  text-decoration: none;
  margin: 20px;
  color: #fff;
  position: relative;
  display: inline-block;
  border: none 0;
  background-color: #55acee;
  box-shadow: 0px 5px 0px 0px #3C93D5;
}

button:active {
  transform: translate(0px, 5px);
  box-shadow: 0px 1px 0px 0px;
  outline: none;
}

button:hover {
  background-color: #6FC6FF;
  outline: none;
}

span {
  font-size: 3rem;
  display: inline-block;
  vertical-align: middle
}
View Compiled
// Increment by passing object
class IncrementByObj extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			count: 0
		};
		this.increment = this.increment.bind(this);
	}
	
	increment() {
		this.setState({
			count: this.state.count + 1
		});
		
		this.setState({
			count: this.state.count + 1
		});
	}
	
	render() {
		return (
			<div>
				<button onClick={this.increment}>IncrementByObject</button>
				<span>{this.state.count}</span>
			</div>
		);
	}
}

// Increment by passing function
class IncrementByFunction extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			count: 0
		};
		this.increment = this.increment.bind(this);
	}
	
	increment() {
		this.setState((prevState, props) => ({
			count: prevState.count + 1
		}));
		this.setState((prevState, props) => ({
			count: prevState.count + 1
		}));
	}
	
	render() {
		return (
			<div>
				<button onClick={this.increment}>IncrementByFunction</button>
				<span>{this.state.count}</span>
			</div>
		);
	}
}

ReactDOM.render(
	<div>
		<IncrementByObj />
		<IncrementByFunction />
	</div>,
	document.getElementById('root')
);
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js