form action

The action prop of a form, or formAction on a button, which in React can be a Server Action that receives the submitted FormData.

In more detail

In plain HTML, action is the URL a form posts to. React also accepts a function there, which receives the form data when the form is submitted.

Examples

<form action={registerUser}>...</form>
Passing a Next.js Server Action to action works even before JavaScript loads, because React renders a real HTML form that posts to the server.

Related terms

Taught in

References