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.
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?
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'svalue
state usingsetFieldValue()
, 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!