formbold-react
Version:
Formbold package for react.
15 lines (14 loc) • 555 B
TypeScript
import { type SyntheticEvent } from 'react';
import { CaptchaRef, Config, ErrorState } from './types';
/**
* FormBold useForm hook
* @param formId - The form ID
* @param config - Configuration options
* @returns An array containing the form state and the submit handler
*/
declare const useForm: (formId: string, config?: Config) => readonly [{
readonly error: ErrorState;
readonly succeeded: boolean;
readonly submitting: boolean;
}, (e: SyntheticEvent<HTMLFormElement>, recaptchaRef?: CaptchaRef) => Promise<void>];
export { useForm };