How do I programatically fill input field value with React?

前端 未结 4 769
情歌与酒
情歌与酒 2021-01-05 14:28

I have a modal with some input fields. I can easily pass the data automatically with the user typing an input, using onChange function in the input field, as

4条回答
  •  悲&欢浪女
    2021-01-05 14:49

    Pass in the value property for input:

     {this.setState({value: e.target.value })}/>
    

提交回复
热议问题