Discussion on: You May Not Need Controlled Form Components

jesseskinner profile image
Jesse Skinner

Good points! Another nice vanilla-JavaScript way to get data from all the inputs in one object, useful for sending to an API, is by using:

const data = Object.fromEntries(new FormData(event.target))
swyx profile image
shawn swyx wang πŸ‡ΈπŸ‡¬ Author

thanks! good trick i'll probably use in future.