How do I programatically fill input field value with React?

前端 未结 4 788
情歌与酒
情歌与酒 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:48

    you can use the controlled component and pass the value to it.

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

提交回复
热议问题