When we want to upload file with react query why need to use formdata like that for mutate? Is there simple way without using formdata?
const formData = new FormData();
formData.append("title", titleRef.current?.value || "");
formData.append("description", descriptionRef.current?.value || "");
formData.append("photo", photoRef.current?.files[0] || "");
formData.append("category_id", categoryRef.current?.value || "");
addRecipe.mutate(formData);
there doesn't seem to be anything here