CodePark/ questions / Forms
START PRACTICINGPRACTICE
Frontend question · React › Forms

In React 19, what does saveUser receive when the form is submitted?

function saveUser(arg) {
  // ...
}

<form action={saveUser}>
  <input name="email" />
  <button type="submit">Save</button>
</form>
A FormData object with the form's fields

saveUser receives a FormData object. In React 19, when you pass a function to action, React calls it with the form's FormData. Read values with formData.get('email').

"The submit event" is the tempting wrong answer. React handles the submission itself, so you don't get an event and the page does not reload. It is not a plain object either.
action accepts functions in React 19, not only URL strings. After the action succeeds, React resets the uncontrolled fields.