worthy-azureW
Refine3y ago
4 replies
worthy-azure

nested naming not fetching data correactly

iam using useForm for my form and my input component looks like this
<Autocomplete
type={FormInputTypeEnum.AUTOCOMPLETE}
name={"lead_datas[0].bank_account_time_type"}
label={""}
fullWidth
options={bankAccountTypes}
{...fieldData}
/>
here name is lead_datas[0].bank_account_time_type as the api response is like this. but the problem is after i edit the form and submit, it when i open again, it is not fetching the new data. after a re-render it works. there is no issue on my componet with direct name i mean without nesting.
<Autocomplete
type={FormInputTypeEnum.AUTOCOMPLETE}
name={"bank_account_time_type"}
label={""}
fullWidth
options={bankAccountTypes}
{...fieldData}
/>
this component works perfectly as the value is not nested in api response
how to fix this
Was this page helpful?