'How to reset react hook form after submitting the form

const onSubmit = (data) => {
  const url = `http://localhost:5000/product`;
  fetch(url, {
    method: "POST",
    headers: {
      "content-type": "application/json"
    },
    body: JSON.stringify(data)
  })
  .then(res => res.json())
  .then(result => {
    toast("Item added successfully");          
  })
};


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source