jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.99k stars 2.79k forks source link

Formik form actions cannot be used on nextjs server actions #3977

Open erlanggaht opened 4 months ago

erlanggaht commented 4 months ago

Bug report

When using

from Formik, the server action does not execute, but it works when using a regular HTML form element

Problem Recording

https://github.com/jaredpalmer/formik/assets/118288247/1fdc54fb-b73d-4079-90a9-9ca9fde2167d

Software Version(s)
Formik ^2.4.6
React ^18
Browser Mozilla, Chrome, IE
npm/Yarn npm
Operating System Window 11
juliangorge commented 3 months ago

Hi @erlanggaht , could you tell me if you resolved this and do you know how can send 1_$ACTION_REF1, 1$ACTION1:0, 1$ACTION1:1, 1$ACTION_KEY fields of NextJS Server action security layer with Formik?

stefanedberg commented 3 months ago

I'm having the same issue. Would be nice if this could be supported. Seems like it works by using <form> without the onSubmit event, but it ruins Formik behavior, so not really an alternative.

<form onReset={formikProps.handleReset} action={action} {...props} />

https://formik.org/docs/api/form

fabriciob-ciandt commented 2 months ago

Hi team is there some updates about that? We have the same issue.

juliangorge commented 2 months ago

Hi team is there some updates about that? We have the same issue.

nop from my side

na-zi-ya commented 4 days ago

I am using Formik in my Next.js application. When I click the submit button without filling out the form, another modal unexpectedly opens, while the current form shows validation messages. What could be causing this issue?