https://stackoverflow.com/questions/78076758/remix-unable-to-get-formdata-from-the-routes
I have created a question on stackoverflow. Trying to understand why cant I use the form data get function to retrieve form data fields?
#Unable to get form data from function form.get()
1 messages · Page 1 of 1 (latest)
make action an async function, then do ```js
const formData = await request.formData();
oh hadn't realized it was answered forgot to scroll down 😅
but your FormData actually isn't empty, you'll need to either use formData.get() or if you want to see everything at once you can use Object.fromEntries(formData)
Thank you @unborn dome . Yes I saw your comment. I thought may be we could read the formdata as is. Why is the data not shown though?
According to MDN, FormData is a special kind of object that has its own methods for data access. So just logging the raw object won’t work, need to use the methods it defines or it seems you can use things like Object.fromEntries or for…of loops with .entries()