worthy-azureW
Refine3y ago
5 replies
worthy-azure

edit form submit

I have a useEffect in my Autocomplete component
useEffect(() => {
if (
initialReturnValueTransformer &&
initialRender &&
useFormProps?.formState.defaultValues &&
useFormProps?.refineCore.formLoading === false
) {
const initialVal = useFormProps?.getValues && useFormProps?.getValues(name);
console.log(useFormProps.refineCore.formLoading, "llll");
console.log("heree");
setSelectedOption(initialVal);
fieldRef?.current?.onChange(
initialReturnValueTransformer && initialReturnValueTransformer(initialVal)
);
setInitialRender(false);
}
}, [useFormProps?.formState]);

in my edit page, iam setting value to its id at initial render. noiw when I submit the form and after success, i came to same edit page and try submit again then the value is not transforming or transformed value is reverting
Was this page helpful?