@payfit/unity-components
Version:
25 lines (24 loc) • 1 kB
TypeScript
/**
* `TanstackForm` is a form wrapper bound to the TanStack form context.
* It prevents the default browser submission, delegates to the TanStack form
* `handleSubmit`, and then invokes the provided `onSubmit` (if any).
*
* Behavior:
* - `onSubmit` handler: prevents default, calls `form.handleSubmit(event)`, then
* forwards the event to the user-provided `onSubmit`.
* - Exposes a standard `<form>` element API via `ComponentProps<'form'>`.
*
* Usage:
* ```tsx
* function Example() {
* const form = useTanstackUnityForm<{ name: string }>({ validators: {} })
* return (
* <TanstackForm>
* <form.AppField name="name">{() => <TanstackInput />}</form.AppField>
* </TanstackForm>
* )
* }
* ```
*/
declare const TanstackForm: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import('react').RefAttributes<HTMLFormElement>>;
export { TanstackForm };