Open martypowell opened 5 years ago
This has been partially implemented. Service Request Form was done but the others have not been. The utility has been created SetFieldValues in the FormHelpers. Example of use:
const fields = { NameFirst: NameFirst, NameLast: NameLast, Email: Email, Telephone: Phone };
SetFieldValues(localProps, fields);
We should leave this open until all forms have been converted.
This is good, I copied this new function and made on for setting fields as touched in the FormikHelper file. Probably where this should go eventually.
@tmccoy529 i actually think this is done right?
@martypowell I have been updating pages as I come across them but have not set out to do just this refactor. Lets leave it open for now since I'm not totally sure all pages have been converted.
Oh i think this issue was just to add the helper. I am fine with what you are saying though.
There are places in the app that we set serveral formik fields at a time, see an example here, https://github.com/baltimorecounty/react-baltcogo/blob/bug-fixes/src/components/ServiceRequestForm.jsx#L128
We can create a FormikHelper function to pass either an object or an array to set field values, something like. We should also verify that formik doesn't already have something for this. Because maybe we don't even need to do this.