From d02124aae68c57569e225cd47facfd0fefbc66d3 Mon Sep 17 00:00:00 2001 From: Michael Angelo Rivera <55844504+michaelangeloio@users.noreply.github.com> Date: Wed, 30 Aug 2023 06:20:55 -0700 Subject: [PATCH] docs: clarify data type in Forms and Mutations section (#54630) ### What? Clarify the "Forms and Mutations" docs. ### Why? This may be opinionated, but I believe this section of the docs starts out assuming that the user knows how the `
` HTML works. Coming from the client side React world, most developers are used to using state in forms. Clarifying that this data is accessible via the standard web API [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData) is essential for both transitioning developers and new developers. --- .../02-data-fetching/03-forms-and-mutations.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/03-forms-and-mutations.mdx b/docs/02-app/01-building-your-application/02-data-fetching/03-forms-and-mutations.mdx index 2fcff4d19844b..e723edca123fc 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/03-forms-and-mutations.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/03-forms-and-mutations.mdx @@ -170,6 +170,8 @@ export default function Page() { } ``` +> **Good to know**: `` takes the [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData) data type. In the example above, the FormData submitted via the HTML [`form`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) is accessible in the server action `create`. + ### Revalidating Data Server Actions allow you to invalidate the [Next.js Cache](/docs/app/building-your-application/caching) on demand. You can invalidate an entire route segment with [`revalidatePath`](/docs/app/api-reference/functions/revalidatePath):