Clear and reset form input fields

前端 未结 12 1942
小蘑菇
小蘑菇 2020-11-28 22:36

I have a form containing various input fields and two buttons; one for submitting and one for cancelling.

12条回答
  •  無奈伤痛
    2020-11-28 23:25

    I don't know if this is still relevant. But when I had similar issue this is how I resolved it.

    Where you need to clear an uncontrolled form you simply do this after submission.

    this..setState({value: ''});
    

    Hope this helps.

提交回复
热议问题