class { onInput(input) { this.state = { size: input.size || 'normal' }; } setSize(size) { this.state.size = size; } }