I am using a material ui autocomplete field in a Formik form, the form is part of a step form and my problem is that I cannot retrieve the value of the autocomplete field that has been selected by the user when I go back and forth through the form steps . Next I expose the piece of code that I have implemented and that has such a reported problem. Thank you all for the help you can provide.
<Autocomplete
defaultValue= {obrasoc.find((os) => os.nom_os == field.value)}
options={obrasoc}
getOptionLabel={(option) => option.nom_os}
isOptionEqualToValue={(option, value) => option.nom_os === value.nom_os}
renderInput={(params) => (
<TextField
{...params}
label='Obra Social'
variant="standard"
error={meta.touched && meta.error && true}
helperText={_renderHelperText()}
/>
)}
onChange={(e, value) => {
console.log('onchange', value);
fieldHelpers.setValue(value.nom_os)
}}
/>