Rocky_Mountain_Vending/.pnpm-store/v10/files/df/64322bbcc06a2a78dddc5b62febec76a321fbb65b5167460ced5df042bd363313ce3d376eb87bd803117fd533837dede6a72c002bc026e377409255306f730
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

65 lines
No EOL
2.3 KiB
Text

import React from 'react';
import type { FieldValues, FormProviderProps, UseFormReturn } from './types';
/**
* This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}.
*
* @remarks
* [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
*
* @returns return all useForm methods
*
* @example
* ```tsx
* function App() {
* const methods = useForm();
* const onSubmit = data => console.log(data);
*
* return (
* <FormProvider {...methods} >
* <form onSubmit={methods.handleSubmit(onSubmit)}>
* <NestedInput />
* <input type="submit" />
* </form>
* </FormProvider>
* );
* }
*
* function NestedInput() {
* const { register } = useFormContext(); // retrieve all hook methods
* return <input {...register("test")} />;
* }
* ```
*/
export declare const useFormContext: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>() => UseFormReturn<TFieldValues, TContext, TTransformedValues>;
/**
* A provider component that propagates the `useForm` methods to all children components via [React Context](https://react.dev/reference/react/useContext) API. To be used with {@link useFormContext}.
*
* @remarks
* [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
*
* @param props - all useForm methods
*
* @example
* ```tsx
* function App() {
* const methods = useForm();
* const onSubmit = data => console.log(data);
*
* return (
* <FormProvider {...methods} >
* <form onSubmit={methods.handleSubmit(onSubmit)}>
* <NestedInput />
* <input type="submit" />
* </form>
* </FormProvider>
* );
* }
*
* function NestedInput() {
* const { register } = useFormContext(); // retrieve all hook methods
* return <input {...register("test")} />;
* }
* ```
*/
export declare const FormProvider: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
//# sourceMappingURL=useFormContext.d.ts.map