Skip to content

Instantly share code, notes, and snippets.

@Giagnus64
Last active November 13, 2019 04:18
Show Gist options
  • Select an option

  • Save Giagnus64/684f66d12f7fa4a5e4ecfdd21175d5a7 to your computer and use it in GitHub Desktop.

Select an option

Save Giagnus64/684f66d12f7fa4a5e4ecfdd21175d5a7 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
class Counter extends Component{
state={
balance: 0
}
//const withdraw10 = () => {...}
//const deposit10 = () => {...}
render(){
return(
<div>
<button onClick={this.deposit10}>Deposit $10</button>
<button onClick={this.withdraw10}>Withdraw $10</button>
<p>Balance:{this.state.balance}</p>
</div>
)
}
}
export default Counter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment