Skip to content

Commit

Permalink
fix(react-form): export WithFormProps type (#1235)
Browse files Browse the repository at this point in the history
* feat(react-form): export `WithFormProps` type

* fix(react-form): re-export from barrel index.ts file

* ci: apply automated fixes and generate docs

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
pavle99 and autofix-ci[bot] authored Mar 6, 2025
1 parent 6c67a26 commit 24dfe42
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/framework/react/reference/functions/createformhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ withForm: <TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync

##### \_\_namedParameters

`WithFormProps`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`, `TComponents`, `TFormComponents`, `TRenderProps`\>
[`WithFormProps`](../interfaces/withformprops.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`, `TComponents`, `TFormComponents`, `TRenderProps`\>

#### Returns

Expand Down
1 change: 1 addition & 0 deletions docs/framework/react/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ title: "@tanstack/react-form"
## Interfaces

- [ReactFormApi](interfaces/reactformapi.md)
- [WithFormProps](interfaces/withformprops.md)

## Type Aliases

Expand Down
72 changes: 72 additions & 0 deletions docs/framework/react/reference/interfaces/withformprops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
id: WithFormProps
title: WithFormProps
---

<!-- DO NOT EDIT: this page is autogenerated from the type comments -->

# Interface: WithFormProps\<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, TFieldComponents, TFormComponents, TRenderProps\>

Defined in: [packages/react-form/src/createFormHook.tsx:136](https://github.com/TanStack/form/blob/main/packages/react-form/src/createFormHook.tsx#L136)

## Extends

- `FormOptions`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>

## Type Parameters

**TFormData**

**TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>

**TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>

**TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>

**TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>

**TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>

**TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>

**TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>

**TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>

**TSubmitMeta**

**TFieldComponents** *extends* `Record`\<`string`, `ComponentType`\<`any`\>\>

**TFormComponents** *extends* `Record`\<`string`, `ComponentType`\<`any`\>\>

**TRenderProps** *extends* `Record`\<`string`, `unknown`\> = `Record`\<`string`, `never`\>

## Properties

### props?

```ts
optional props: TRenderProps;
```

Defined in: [packages/react-form/src/createFormHook.tsx:163](https://github.com/TanStack/form/blob/main/packages/react-form/src/createFormHook.tsx#L163)

***

### render()

```ts
render: (props) => Element;
```

Defined in: [packages/react-form/src/createFormHook.tsx:164](https://github.com/TanStack/form/blob/main/packages/react-form/src/createFormHook.tsx#L164)

#### Parameters

##### props

`PropsWithChildren`\<`NoInfer`\<`TRenderProps`\> & `object`\>

#### Returns

`Element`
2 changes: 1 addition & 1 deletion packages/react-form/src/createFormHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ type AppFieldExtendedReactFormApi<
AppForm: ComponentType<PropsWithChildren>
}

interface WithFormProps<
export interface WithFormProps<
TFormData,
TOnMount extends undefined | FormValidateOrFn<TFormData>,
TOnChange extends undefined | FormValidateOrFn<TFormData>,
Expand Down
2 changes: 2 additions & 0 deletions packages/react-form/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ export type { UseField, FieldComponent } from './useField'
export { useField, Field } from './useField'

export { useTransform } from './useTransform'

export type { WithFormProps } from './createFormHook'
export { createFormHook, createFormHookContexts } from './createFormHook'

0 comments on commit 24dfe42

Please sign in to comment.