Migration Guide From 1.2.x to 1.3.x
FormInstance
formListInstance.submit()
Now, this function result is changed, instead of rejecting promise on validate error, errors from validate will be included in promise's result. To prevent error: Uncaught (in promise) !Rejected.
Old
ts
interface FormInstance {
submit(onSuccess: (values: any) => void, onError: (errors: ValidateError[])): Promise<any> | void;
}
New
ts
interface FormInstance {
submit(onSuccess: (values: any) => void, onError: (errors: ValidateError[])): Promise<{values?: any; errors?: ValidateError[]}> | void;
}
If you upgrade from old version, you have to remove all catch
when call submit and use then
only.
formInstance.validate()
Same as formInstance.submit()
, instead of rejecting promise on validate error, errors from validate will be included in promise's result.
Old
ts
interface FormInstance {
validate(name?: string | NamePath[], options?: ValidateOption): Promise<any>;
}
New
ts
interface FormInstance {
validate(
name?: string | NamePath[],
options?: ValidateOption
): Promise<{ values?: any; errors?: ValidateError[] }>;
}
FormListInstance
formListInstance.namePaths
Replaced with: fields
.
It is removed from this version and replaced with property fields
. So, everywhere using it, including EzFormList's
slot default, have to change to use fields instead.