From 5fd7a5f48216725ab87164d3a3d3c826c747e9d5 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Fri, 8 Mar 2024 15:06:01 +0100 Subject: [PATCH 1/2] Docs: Add information about $ACTION_ formData --- .../02-data-fetching/02-server-actions-and-mutations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx b/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx index 7a18bcabca6ba7..fd6b38d0ed47b9 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx @@ -171,7 +171,7 @@ export default function Page() { > **Good to know:** > > - Example: [Form with Loading & Error States](https://github.com/vercel/next.js/tree/canary/examples/next-forms) -> - When working with forms that have many fields, you may want to consider using the [`entries()`](https://developer.mozilla.org/en-US/docs/Web/API/FormData/entries) method with JavaScript's [`Object.fromEntries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries). For example: `const rawFormData = Object.fromEntries(formData.entries())` +> - When working with forms that have many fields, you may want to consider using the [`entries()`](https://developer.mozilla.org/en-US/docs/Web/API/FormData/entries) method with JavaScript's [`Object.fromEntries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries). For example: `const rawFormData = Object.fromEntries(formData.entries())`, although note that the `formData` will include additional properties with keys starting with `$ACTION_` > - See [React `
` documentation](https://react.dev/reference/react-dom/components/form#handle-form-submission-with-a-server-action) to learn more. #### Passing Additional Arguments From 84bacdd6ba514ce2c4c42acd920390736edba50f Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Fri, 8 Mar 2024 15:02:30 -0800 Subject: [PATCH 2/2] Update 02-server-actions-and-mutations.mdx --- .../02-data-fetching/02-server-actions-and-mutations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx b/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx index fd6b38d0ed47b9..5b785701099f93 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx @@ -171,7 +171,7 @@ export default function Page() { > **Good to know:** > > - Example: [Form with Loading & Error States](https://github.com/vercel/next.js/tree/canary/examples/next-forms) -> - When working with forms that have many fields, you may want to consider using the [`entries()`](https://developer.mozilla.org/en-US/docs/Web/API/FormData/entries) method with JavaScript's [`Object.fromEntries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries). For example: `const rawFormData = Object.fromEntries(formData.entries())`, although note that the `formData` will include additional properties with keys starting with `$ACTION_` +> - When working with forms that have many fields, you may want to consider using the [`entries()`](https://developer.mozilla.org/en-US/docs/Web/API/FormData/entries) method with JavaScript's [`Object.fromEntries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries). For example: `const rawFormData = Object.fromEntries(formData.entries())`. One thing to note is that the `formData` will include additional `$ACTION_`properties. > - See [React `` documentation](https://react.dev/reference/react-dom/components/form#handle-form-submission-with-a-server-action) to learn more. #### Passing Additional Arguments