受控组件
render() {
return <div>
<p>{this.state.name}</p>
<label htmlFor="inputName">姓名:</label>
<input value={this.state.name} onChange={this.onInputChange} />
</div>
}
onInputChange = (e) => {
this.setState({
name: e.target.value
})
}
textarea
<textarea value={this.state.info} onChange={this.onTextareaChange}></textarea>