rfa
Version:
**React Form Architect** is an ultimate solution for creating and rendering forms in React. Its main focus is to provide users with a tool to define, render and share a form in a browser.
21 lines (16 loc) • 466 B
text/typescript
import { Control, FieldError, useForm } from "react-hook-form";
export type FormContextType = {
register: ReturnType<typeof useForm>["register"];
name: string;
};
export type FormControlType = {
control: Control;
name: string;
};
export type FormCustomRegisterType = FormContextType & {
setValue: ReturnType<typeof useForm>["setValue"];
unregister: ReturnType<typeof useForm>["unregister"];
};
export type FormFieldError = {
error?: FieldError;
};