--- id: use-form-submit title: useForm --- This hook allows you to define new fields that will be used in the validation and submit phase **input parameters** ```ts export type FunctionOnSubmit = (values: ValueType) => Promise | void; export type FormSubmitOptions = { onSubmit: FunctionOnSubmit; }; ``` `onSubmit`: this function is performed when the submit is called **return** ```ts export type FormSubmitReturn = { submit: (event?: React.BaseSyntheticEvent) => void; validate: () => void; reset: () => void; }; ``` `submit`: function to be used to invoke the form submission `validate`: function to be used to force the validation of the form fields `reset`: function to be used to force the reset of the form fields **example** ```tsx export const FormInternal: React.FC = () => { const { submit, validate, reset } = useForm({ onSubmit: (values) => console.log("values", values)}); return (
); }; ```