class {
    onInput(input) {
        this.state = {
            name: input.name
        };
    }
    setName(newName) {
        this.setState('name', newName);
    }
}

<div>
    Hello ${state.name}!
</div>