feat(form): ✨ enhance form functionality and API integration
* Refactor key handling to use uniqueKeyField * Add reset functionality to clear dirty state after save * Introduce new API call specifications for REST and resolve * Implement predefined wrappers for dialogs and popovers * Update todo list to reflect completed tasks
This commit is contained in:
@@ -78,11 +78,20 @@ const FormerInner = forwardRef<FormerRef<any>, Partial<FormerProps<any>> & Props
|
||||
return await validate();
|
||||
},
|
||||
}),
|
||||
[getState, onChange]
|
||||
[getState, onChange, validate, save, reset, setState, onClose, onOpen]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setState('getFormMethods', () => formMethods);
|
||||
|
||||
if (formMethods) {
|
||||
formMethods.subscribe({
|
||||
formState: { isDirty: true },
|
||||
callback: ({ isDirty }) => {
|
||||
setState('dirty', isDirty);
|
||||
},
|
||||
});
|
||||
}
|
||||
}, [formMethods]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user