jaredpalmer / formik

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

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

Open erlanggaht opened 2 months ago

erlanggaht commented 2 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 1 month 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 weeks 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