This repository has been archived on 2025-07-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2025-01-11 09:54:09 +03:00

27 lines
767 B
TypeScript

import React from 'react';
import { FieldValues, FormProps } from './types';
/**
* Form component to manage submission.
*
* @param props - to setup submission detail. {@link FormProps}
*
* @returns form component or headless render prop.
*
* @example
* ```tsx
* function App() {
* const { control, formState: { errors } } = useForm();
*
* return (
* <Form action="/api" control={control}>
* <input {...register("name")} />
* <p>{errors?.root?.server && 'Server error'}</p>
* <button>Submit</button>
* </Form>
* );
* }
* ```
*/
declare function Form<T extends FieldValues, U extends FieldValues | undefined = undefined>(props: FormProps<T, U>): React.JSX.Element;
export { Form };
//# sourceMappingURL=form.d.ts.map