怎么使用react改变Input的value
export default class myForm extends Component{
constructor(props){
super(props);
this.state = {
id: '',
};
}
change=()=>{
var idInput = this.refs.idInput;
***// TODO 怎么改变input的值***
}
render(){
return(
<Input
ref="idInput"
placeholder="请输入"
onChange={e => this.setState({id:e.target.value})}
/>
<Button onClick={this.change} />
)
}
}