class {
    onInput(input) {
        this.state = {
            counter: input.value
        }
    }

    increment() {
        this.state.counter++;
    }
}

<div>
    Count: ${state.counter}
</div>
