Hi guys. I'm new to React & Formik.
I'm implementing a form that has a formik form & an image uploader
Whenever an image is uploaded i set its src value to component's state, then there comes an issue that all data which have been input into formik are reset. I think the reason may be the component is re-rendered when state changes and formik also is reset to its initial state.
Could someone please advise if i'm doing something wrongly?
If you change Formik's initialValues it will reset the form. You can turn this off by flagging the prop enableReinitialize
enableReinitialize
If I disable this option, can I work with Redux normally? I have a form that is used for both editing and data creation / entry. However, whenever a onChange event occurs in a select, the inputs texts are cleared.
Most helpful comment
If you change Formik's initialValues it will reset the form. You can turn this off by flagging the prop
enableReinitialize