Skip to content
Justice Tech School

Actions and use

Newer React lets forms call functions directly and use reads promises.

Example
function Add() {
  async function save(formData) {
    console.log(formData.get("name"));
  }
  return (
    <form action={save}>
      <input name="name" />
      <button>Save</button>
    </form>
  );
}

Exercise

Form attribute.

<form ={save}>

Quiz Test

What can a form action be in React 19?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.