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

Update 02-server-actions-and-mutations.mdx #64248

Merged
merged 4 commits into from
Apr 12, 2024
Merged

Conversation

aktoriukas
Copy link
Contributor

Improving Documentation

mistake in the docs.

action should not be apply on the button.
only formAction or onClick is allow.

mistake in the docs.

action should not be apply on the button.
only formAction or onClick is allow.
@aktoriukas aktoriukas requested review from a team as code owners April 9, 2024 09:58
@aktoriukas aktoriukas requested review from jh3y and delbaoliveira and removed request for a team April 9, 2024 09:58
@samcx
Copy link
Member

samcx commented Apr 10, 2024

@aktoriukas Thanks for the catch! Let's use onClick instead here.

adding `onClick` instead of the `formAction` as per `samcx` request.

also adding `'use client'` as to use `onClick` component has to be client component.
@aktoriukas
Copy link
Contributor Author

ok @samcx ,

adding onClick instead of the formAction.

also adding 'use client' as to use onClick component it has to be client component.

Copy link
Member

@samcx samcx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@samcx samcx enabled auto-merge (squash) April 11, 2024 17:23
auto-merge was automatically disabled April 12, 2024 08:52

Base branch was modified

@samcx samcx merged commit 322ecdf into vercel:canary Apr 12, 2024
32 checks passed
@hnordt
Copy link

hnordt commented Apr 12, 2024

@aktoriukas Thanks for the catch! Let's use onClick instead here.

@samcx just for curiosity and learning, why did you suggest to use onClick instead of formAction there?

@@ -928,11 +929,12 @@ export default function Page() {
...
}

return <button action={publish}>Publish</button>;
return <button onClick={publish}>Publish</button>;
Copy link
Contributor

@AhmedBaset AhmedBaset Apr 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samcx
onClick passes MouseEvent param not FormData. formAction was correct

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@A7med3bdulBaset Thanks for the correction, will update!

samcx added a commit that referenced this pull request Apr 12, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants