Want to send my user email that I have from Firebase Login to my MongoDB Database. I'm using react hook form to Add New Product (product name, information, price, quantity etc.) and also send my User Email with this form data. I've solved this kinds of problems using Axios.Post method. Now I want to do this using React Hook Form . I need help solving this problem... Screenshot: This is my form data handler, and I've imported useAuthState(auth) to get user email
onSubmit= data => {
data.email = user?.email;
}
Add this line in onSubmit and the rest of the code will be the same.