UNPKG

767 BTypeScriptView Raw
1import React from 'react';
2import { FieldValues, FormProps } from './types';
3/**
4 * Form component to manage submission.
5 *
6 * @param props - to setup submission detail. {@link FormProps}
7 *
8 * @returns form component or headless render prop.
9 *
10 * @example
11 * ```tsx
12 * function App() {
13 * const { control, formState: { errors } } = useForm();
14 *
15 * return (
16 * <Form action="/api" control={control}>
17 * <input {...register("name")} />
18 * <p>{errors?.root?.server && 'Server error'}</p>
19 * <button>Submit</button>
20 * </Form>
21 * );
22 * }
23 * ```
24 */
25declare function Form<T extends FieldValues, U extends FieldValues | undefined = undefined>(props: FormProps<T, U>): React.JSX.Element;
26export { Form };
27//# sourceMappingURL=form.d.ts.map
\No newline at end of file