Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix incorrect usage in Server Action in a Client Component example #68965

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

liby
Copy link
Contributor

@liby liby commented Aug 16, 2024

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.

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Aug 16, 2024
@ijjk
Copy link
Member

ijjk commented Aug 16, 2024

Allow CI Workflow Run

  • approve CI run for commit: 4d0abfa

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk ijjk enabled auto-merge (squash) September 12, 2024 21:12
@ijjk ijjk merged commit 7bbc782 into vercel:canary Sep 12, 2024
38 checks passed
@liby liby deleted the fix/button-component-usage branch September 13, 2024 01:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Related to Next.js' official documentation. locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants