From 7bbc782e4e25a6037f89162ca12a5f7c5072d873 Mon Sep 17 00:00:00 2001 From: Bryan Lee <38807139+liby@users.noreply.github.com> Date: Fri, 13 Sep 2024 05:16:10 +0800 Subject: [PATCH] docs: fix incorrect usage in Server Action in a Client Component example (#68965) ## What? This PR fixes an incorrect usage of the `Button` component in the client component example. The example mistakenly used a `Button` component without importing or defining it properly, whereas the intent was to use the native HTML `button` element. ## Why? The original example incorrectly suggested that a custom `Button` component was being used. However, the intent was likely to demonstrate the usage of the native `button` element with an `onClick` handler to trigger a Server Action. The existing code could lead to confusion, as it implied the existence of a custom component named `Button` without any clear definition or `import`, which would also result in a recursive component reference issue. ## How? This fix ensures that the example clearly demonstrates the intended use of the native button element with an `onClick` handler, aligning with best practices and avoiding potential errors or misunderstandings in component usage. Co-authored-by: JJ Kasper --- .../02-data-fetching/03-server-actions-and-mutations.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx b/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx index 419c0adcf0c26..73d4a06c51e09 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx @@ -66,7 +66,7 @@ export async function create() {} import { create } from '@/app/actions' export function Button() { - return } ``` @@ -76,7 +76,7 @@ export function Button() { import { create } from '@/app/actions' export function Button() { - return } ```