docs: fix incorrect usage in Server Action in a Client Component example #68965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR fixes an incorrect usage of the
Button
component in the client component example. The example mistakenly used aButton
component without importing or defining it properly, whereas the intent was to use the native HTMLbutton
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 nativebutton
element with anonClick
handler to trigger a Server Action. The existing code could lead to confusion, as it implied the existence of a custom component namedButton
without any clear definition orimport
, 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.