postlight / trimmings

🌲 Get back to HTML.
https://postlight.github.io/trimmings
Apache License 2.0
221 stars 8 forks source link

Serializing form - why so complicated? #42

Open garygreen opened 4 years ago

garygreen commented 4 years ago

Reference this line and serialize import:

https://github.com/postlight/trimmings/blob/d5e4b12616e01611564bb4356b4b47f1273f62de/src/utils/loadElement.js#L19

If the element is a form then couldn't this just be simplifed as new FormData(element) and pass that onto fetch ? There's no need to manually serialize form and it's elements...