-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fcee08
commit 4c87d70
Showing
32 changed files
with
395 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Function: createServerValidate() | ||
|
||
```ts | ||
function createServerValidate<TFormData, TFormValidator>(defaultOpts?): ValidateFormData<TFormData, TFormValidator> | ||
``` | ||
|
||
## Type parameters | ||
|
||
• **TFormData** | ||
|
||
• **TFormValidator** *extends* `undefined` \| `Validator`\<`TFormData`, `unknown`\> = `undefined` | ||
|
||
## Parameters | ||
|
||
• **defaultOpts?**: `FormOptions`\<`TFormData`, `TFormValidator`\> | ||
|
||
## Returns | ||
|
||
`ValidateFormData`\<`TFormData`, `TFormValidator`\> | ||
|
||
## Source | ||
|
||
[createServerValidate.ts:40](https://github.com/TanStack/form/blob/2fcee08730ef56cadb9b5937d06198bcc1fedcd7/packages/react-form/src/createServerValidate.ts#L40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Function: Field() | ||
|
||
```ts | ||
function Field<TParentData, TName, TFieldValidator, TFormValidator, TData>(__namedParameters): ReactNode | ||
``` | ||
|
||
A function component that takes field options and a render function as children and returns a React component. | ||
|
||
The `Field` component uses the `useField` hook internally to manage the field instance. | ||
|
||
## Type parameters | ||
|
||
• **TParentData** | ||
|
||
• **TName** *extends* `string` \| `number` | ||
|
||
• **TFieldValidator** *extends* `undefined` \| `Validator`\<`DeepValue`\<`TParentData`, `TName`\>, `unknown`\> = `undefined` | ||
|
||
• **TFormValidator** *extends* `undefined` \| `Validator`\<`TParentData`, `unknown`\> = `undefined` | ||
|
||
• **TData** = `DeepValue`\<`TParentData`, `TName`\> | ||
|
||
## Parameters | ||
|
||
• **\_\_namedParameters**: `FieldComponentProps`\<`TParentData`, `TName`, `TFieldValidator`, `TFormValidator`, `TData`\> | ||
|
||
## Returns | ||
|
||
`ReactNode` | ||
|
||
## Source | ||
|
||
[useField.tsx:171](https://github.com/TanStack/form/blob/2fcee08730ef56cadb9b5937d06198bcc1fedcd7/packages/react-form/src/useField.tsx#L171) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Type alias: FieldComponent()\<TParentData, TFormValidator\> | ||
|
||
```ts | ||
type FieldComponent<TParentData, TFormValidator>: <TName, TFieldValidator, TData>({ | ||
children, | ||
...fieldOptions | ||
}) => NodeType; | ||
``` | ||
|
||
A type alias representing a field component for a specific form data type. | ||
|
||
## Type parameters | ||
|
||
• **TParentData** | ||
|
||
• **TFormValidator** *extends* `Validator`\<`TParentData`, `unknown`\> \| `undefined` = `undefined` | ||
|
||
## Type parameters | ||
|
||
• **TName** *extends* `DeepKeys`\<`TParentData`\> | ||
|
||
• **TFieldValidator** *extends* `Validator`\<`DeepValue`\<`TParentData`, `TName`\>, `unknown`\> \| `undefined` = `undefined` | ||
|
||
• **TData** *extends* `DeepValue`\<`TParentData`, `TName`\> = `DeepValue`\<`TParentData`, `TName`\> | ||
|
||
## Parameters | ||
|
||
• **\{ | ||
children, | ||
...fieldOptions | ||
\}**: `Omit`\<`FieldComponentProps`\<`TParentData`, `TName`, `TFieldValidator`, `TFormValidator`, `TData`\>, `"form"`\> | ||
|
||
## Returns | ||
|
||
`NodeType` | ||
|
||
## Source | ||
|
||
[useField.tsx:141](https://github.com/TanStack/form/blob/2fcee08730ef56cadb9b5937d06198bcc1fedcd7/packages/react-form/src/useField.tsx#L141) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# @tanstack/react-form | ||
|
||
## Type Aliases | ||
|
||
- [FieldComponent](Type.FieldComponent.md) | ||
- [UseField](Type.UseField.md) | ||
|
||
## Variables | ||
|
||
- [initialFormState](Variable.initialFormState.md) | ||
|
||
## Functions | ||
|
||
- [Field](Function.Field.md) | ||
- [createServerValidate](Function.createServerValidate.md) | ||
- [useField](Function.useField.md) | ||
- [useForm](Function.useForm.md) | ||
- [useTransform](Function.useTransform.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Variable: initialFormState | ||
|
||
```ts | ||
const initialFormState: object; | ||
``` | ||
|
||
## Type declaration | ||
|
||
### errorMap | ||
|
||
```ts | ||
errorMap: object; | ||
``` | ||
|
||
### errorMap.onServer | ||
|
||
```ts | ||
onServer: undefined = undefined; | ||
``` | ||
|
||
### errors | ||
|
||
```ts | ||
errors: never[] = []; | ||
``` | ||
|
||
## Source | ||
|
||
[createServerValidate.ts:72](https://github.com/TanStack/form/blob/2fcee08730ef56cadb9b5937d06198bcc1fedcd7/packages/react-form/src/createServerValidate.ts#L72) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Function: useField() | ||
|
||
```ts | ||
function useField<TParentData, TName, TFieldValidator, TFormValidator, TData>(opts): FieldApi<TParentData, TName, TFieldValidator, TFormValidator, TData> | ||
``` | ||
|
||
A hook for managing a field in a form. | ||
|
||
## Type parameters | ||
|
||
• **TParentData** | ||
|
||
• **TName** *extends* `string` \| `number` | ||
|
||
• **TFieldValidator** *extends* `undefined` \| `Validator`\<`DeepValue`\<`TParentData`, `TName`\>, `unknown`\> = `undefined` | ||
|
||
• **TFormValidator** *extends* `undefined` \| `Validator`\<`TParentData`, `unknown`\> = `undefined` | ||
|
||
• **TData** = `DeepValue`\<`TParentData`, `TName`\> | ||
|
||
## Parameters | ||
|
||
• **opts**: `UseFieldOptions`\<`TParentData`, `TName`, `TFieldValidator`, `TFormValidator`, `TData`\> | ||
|
||
An object with field options. | ||
|
||
## Returns | ||
|
||
`FieldApi`\<`TParentData`, `TName`, `TFieldValidator`, `TFormValidator`, `TData`\> | ||
|
||
The `FieldApi` instance for the specified field. | ||
|
||
## Source | ||
|
||
[useField.tsx:60](https://github.com/TanStack/form/blob/2fcee08730ef56cadb9b5937d06198bcc1fedcd7/packages/react-form/src/useField.tsx#L60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Function: useForm() | ||
|
||
```ts | ||
function useForm<TFormData, TFormValidator>(opts?): FormApi<TFormData, TFormValidator> | ||
``` | ||
|
||
A custom React Hook that returns an instance of the `FormApi` class. | ||
|
||
This API encapsulates all the necessary functionalities related to the form. It allows you to manage form state, handle submissions, and interact with form fields | ||
|
||
## Type parameters | ||
|
||
• **TFormData** | ||
|
||
• **TFormValidator** *extends* `undefined` \| `Validator`\<`TFormData`, `unknown`\> = `undefined` | ||
|
||
## Parameters | ||
|
||
• **opts?**: `FormOptions`\<`TFormData`, `TFormValidator`\> | ||
|
||
## Returns | ||
|
||
`FormApi`\<`TFormData`, `TFormValidator`\> | ||
|
||
## Source | ||
|
||
[useForm.tsx:56](https://github.com/TanStack/form/blob/2fcee08730ef56cadb9b5937d06198bcc1fedcd7/packages/react-form/src/useForm.tsx#L56) |
Oops, something went wrong.