jaredpalmer / formik

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

Using Formik's Wizard (multi-step form) with react-dropzone (file upload field) #2654

Open stevevu opened 4 years ago

stevevu commented 4 years ago

Hi,

I'm trying to use fomik's Wizard (for a multi-step form) with react-dropzone (for a file upload field), but am getting an error trying to let the upload field hook into formik's setFieldValue() to set a state value for the file.

I have an example here @codesandbox: https://codesandbox.io/s/kind-dust-sih0q

In around line 17, I get the formik context in the file upload field using useFormikContext() and then try to set a property into formik's value state using setFieldValue(), but get an infinite loop error.

(If you comment out the line that calls setFieldValue() in the codesandbox, the exact error will display)

Any advice on how to use formik's Wizard with react-dropzone?

thanks!

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days

I-am-abdulazeez commented 3 years ago

Any solution on this?