1// Input field listens to change, updates React's state and re-renders the component.
2<input onChange={e => this.setState({ value: e.target.value })} value={this.state.value} />
3
4// Button is disabled when input state is empty.
5<button disabled={!this.state.value} />