📜  反应中的清除形式 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:20.407000             🧑  作者: Mango

代码示例1
//with the useref hook you can do it easily
const form = useRef(null);

const handlesubmit = () => {
  form.current.reset(); //this will reset all the inputs in the form
}