pull/7063/head
Mert Sincan 2025-01-08 14:35:50 +00:00
parent 99b5d73a7c
commit 8146b84880
1 changed files with 6 additions and 0 deletions

View File

@ -70,6 +70,12 @@ export const useForm = (options = {}) => {
};
const defineField = (field, fieldOptions) => {
if (!field) {
console.warn('The `name` attribute is required for the field definition.');
return []; // prevent errors
}
fields[field]?._watcher.stop();
states[field] ||= getInitialState(field, fieldOptions?.initialValue);