UNPKG

@explita/daily-toolset-components

Version:

A lightweight and versatile collection of TypeScript utility functions and form components, inspired by ShadCN UI, designed for seamless everyday development. Enhance your Node.js, React, and Next.js projects with a well-structured suite of helpers for st

20 lines (19 loc) 932 B
import React, { ReactNode } from "react"; import { useForm } from "../hooks/useForm"; import { UseFormHook } from "../form.hook.type"; type FormContextType = UseFormHook<Record<string, any>>; type FormProviderProps = { children: ReactNode; form?: ReturnType<typeof useForm>; }; export declare const FormContext: React.Context<FormContextType | null>; /** * FormProvider component that supplies form context to its children. * * @param {FormProviderProps} props - The props for the FormProvider component. * @param {ReactNode} props.children - The child components that will have access to the form context. * @param {UseFormHook} [props.form] - An optional form instance to use; if not provided, a new one will be created. * @returns {JSX.Element} The FormContext provider wrapping the children components. */ export declare function FormProvider({ children, form }: FormProviderProps): React.JSX.Element; export {};