class { onInput(input) { this.state = { counter: 1 } } increment() { this.state.counter++; } }