Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/framework/angular/guides/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Finally, you can use a subfield like so:
</ng-container>
```

Where `getPeopleName` is a method on the class like so
Where `getPeopleName` is a method on the class like so:

```typescript
export class AppComponent {
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/angular/guides/dynamic-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: dynamic-validation
title: Dynamic Validation
---

In many cases, you want to change the validation rules based depending on the state of the form or other conditions. The most popular
In many cases, you want to change the validation rules depending on the state of the form or other conditions. The most popular
example of this is when you want to validate a field differently based on whether the user has submitted the form for the first time or not.

We support this through our `onDynamic` validation function.
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/angular/guides/submission-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Submission handling
## Passing additional data to submission handling

You may have multiple types of submission behaviour, for example, going back to another page or staying on the form.
You can accomplish this by specifying the `onSubmitMeta` property. This meta data will be passed to the `onSubmit` function.
You can accomplish this by specifying the `onSubmitMeta` property. This metadata will be passed to the `onSubmit` function.

> Note: if `form.handleSubmit()` is called without metadata, it will use the provided default.

Expand Down Expand Up @@ -65,7 +65,7 @@ export class AppComponent {

## Transforming data with Standard Schemas

While Tanstack Form provides [Standard Schema support](./validation.md) for validation, it does not preserve the Schema's output data.
While TanStack Form provides [Standard Schema support](./validation.md) for validation, it does not preserve the Schema's output data.

The value passed to the `onSubmit` function will always be the input data. To receive the output data of a Standard Schema, parse it in the `onSubmit` function:

Expand Down
8 changes: 4 additions & 4 deletions docs/framework/angular/guides/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ At the core of TanStack Form's functionalities is the concept of validation. Tan

## When is validation performed?

It's up to you! The `[tanstackField]` directive accepts some callbacks as props such as `onChange` or `onBlur`. Those callbacks are passed the current value of the field, as well as the fieldAPI object, so that you can perform the validation. If you find a validation error, simply return the error message as string and it will be available in `field.api.state.meta.errors`.
It's up to you! The `[tanstackField]` directive accepts some callbacks as props such as `onChange` or `onBlur`. Those callbacks are passed the current value of the field, as well as the fieldAPI object, so that you can perform the validation. If you find a validation error, simply return the error message as a string and it will be available in `field.api.state.meta.errors`.

Here is an example:

Expand Down Expand Up @@ -138,7 +138,7 @@ export class AppComponent {
}
```

In the example above, we are validating different things on the same field at different times (at each keystroke and when blurring the field). Since `field.state.meta.errors` is an array, all the relevant errors at a given time are displayed. You can also use `field.state.meta.errorMap` to get errors based on _when_ the validation was done (onChange, onBlur etc...). More info about displaying errors below.
In the example above, we are validating different things on the same field at different times (at each keystroke and when blurring the field). Since `field.state.meta.errors` is an array, all the relevant errors at a given time are displayed. You can also use `field.state.meta.errorMap` to get errors based on _when_ the validation was done (onChange, onBlur etc.). More info about displaying errors below.

## Displaying Errors

Expand Down Expand Up @@ -204,7 +204,7 @@ export class AppComponent {
}
```

It's worth mentioning that our `errors` array and the `errorMap` matches the types returned by the validators. This means that:
It's worth mentioning that our `errors` array and the `errorMap` match the types returned by the validators. This means that:

```angular-ts
@Component({
Expand Down Expand Up @@ -505,7 +505,7 @@ The synchronous validation method (`onBlur`) is run first and the asynchronous m

### Built-in Debouncing

While async calls are the way to go when validating against the database, running a network request on every keystroke is a good way to DDOS your database.
While async calls are the way to go when validating against the database, running a network request on every keystroke is a good way to DDoS your database.

Instead, we enable an easy method for debouncing your `async` calls by adding a single property:

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/lit/guides/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ return html`
export class TestForm extends LitElement {
#form = new TanStackFormController(this, {
defaultValues: {
people: [] as Array<{ name: string}>,
people: [] as Array<{ name: string }>,
},
});
render() {
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/lit/guides/dynamic-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: dynamic-validation
title: Dynamic Validation
---

In many cases, you want to change the validation rules based depending on the state of the form or other conditions. The most popular
In many cases, you want to change the validation rules depending on the state of the form or other conditions. The most popular
example of this is when you want to validate a field differently based on whether the user has submitted the form for the first time or not.

We support this through our `onDynamic` validation function.
Expand Down
8 changes: 4 additions & 4 deletions docs/framework/lit/guides/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ At the core of TanStack Form's functionalities is the concept of validation. Tan

## When is validation performed?

It's up to you! The `field()` method accepts some callbacks as validators such as `onChange` or `onBlur`. Those callbacks are passed the current value of the field, as well as the fieldAPI object, so that you can perform the validation. If you find a validation error, simply return the error message as string and it will be available in `field.state.meta.errors`.
It's up to you! The `field()` method accepts some callbacks as validators such as `onChange` or `onBlur`. Those callbacks are passed the current value of the field, as well as the fieldAPI object, so that you can perform the validation. If you find a validation error, simply return the error message as a string and it will be available in `field.state.meta.errors`.

Here is an example:

Expand Down Expand Up @@ -115,7 +115,7 @@ import { html, nothing } from 'lit'
)}`
```

In the example above, we are validating different things on the same field at different times (at each keystroke and when blurring the field). Since `field.state.meta.errors` is an array, all the relevant errors at a given time are displayed. You can also use `field.state.meta.errorMap` to get errors based on _when_ the validation was done (onChange, onBlur etc...). More info about displaying errors below.
In the example above, we are validating different things on the same field at different times (at each keystroke and when blurring the field). Since `field.state.meta.errors` is an array, all the relevant errors at a given time are displayed. You can also use `field.state.meta.errorMap` to get errors based on _when_ the validation was done (onChange, onBlur etc.). More info about displaying errors below.

## Displaying Errors

Expand Down Expand Up @@ -165,7 +165,7 @@ import { html, nothing } from 'lit'
)}`
```

It's worth mentioning that our `errors` array and the `errorMap` matches the types returned by the validators. This means that:
It's worth mentioning that our `errors` array and the `errorMap` match the types returned by the validators. This means that:

```ts
import { html, nothing } from 'lit'
Expand Down Expand Up @@ -450,7 +450,7 @@ The synchronous validation method (`onBlur`) is run first and the asynchronous m

### Built-in Debouncing

While async calls are the way to go when validating against the database, running a network request on every keystroke is a good way to DDOS your database.
While async calls are the way to go when validating against the database, running a network request on every keystroke is a good way to DDoS your database.

Instead, we enable an easy method for debouncing your `async` calls by adding a single property:

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/lit/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class TestForm extends LitElement {
},
})
render() {
return html` <p>Please enter your first name></p>
return html` <p>Please enter your first name</p>
${this.#form.field(
{
name: `firstName`,
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/guides/async-initial-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function App() {
},
})

if (isLoading) return <p>Loading..</p>
if (isLoading) return <p>Loading...</p>

return (
// ...
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/react/guides/custom-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Custom Errors

TanStack Form provides complete flexibility in the types of error values you can return from validators. String errors are the most common and easy to work with, but the library allows you to return any type of value from your validators.

As a general rule, any truthy value is considered as an error and will mark the form or field as invalid, while falsy values (`false`, `undefined`, `null`, etc..) mean there is no error, the form or field is valid.
As a general rule, any truthy value is considered as an error and will mark the form or field as invalid, while falsy values (`false`, `undefined`, `null`, etc.) mean there is no error, the form or field is valid.

## Return String Values from Forms

Expand Down Expand Up @@ -133,7 +133,7 @@ Display in UI:
}
```

in the example above it depends on the event error you want to display.
In the example above it depends on the event error you want to display.

### Arrays

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/guides/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If you see this error in the console when running `tsc`:
Type instantiation is excessively deep and possibly infinite
```

You've ran into a bug that we didn't catch in our type definitions. While we've done our best to make sure our types are as accurate as possible, there are some edge cases where TypeScript struggled with the complexity of our types.
You've run into a bug that we didn't catch in our type definitions. While we've done our best to make sure our types are as accurate as possible, there are some edge cases where TypeScript struggled with the complexity of our types.

Please [report this issue to us on GitHub](https://github.com/TanStack/form/issues) so we can fix it. Just make sure to include a minimal reproduction so that we're able to help you debug.

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/react/guides/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ id: devtools
title: Devtools
---

TanStack Form comes with a ready to go suit of devtools.
TanStack Form comes with a ready to go suite of devtools.

## Setup

Install the [TanStack Devtools](https://tanstack.com/devtools/latest/docs/quick-start) library and the [TanStack Form plugin](http://npmjs.com/package/@tanstack/react-form-devtools), from the framework adapter that your working in (in this case `@tanstack/react-devtools`, and `@tanstack/react-form-devtools`).
Install the [TanStack Devtools](https://tanstack.com/devtools/latest/docs/quick-start) library and the [TanStack Form plugin](http://npmjs.com/package/@tanstack/react-form-devtools), from the framework adapter that you're working in (in this case `@tanstack/react-devtools`, and `@tanstack/react-form-devtools`).

```bash
npm i @tanstack/react-devtools
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/guides/dynamic-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: dynamic-validation
title: Dynamic Validation
---

In many cases, you want to change the validation rules based depending on the state of the form or other conditions. The most popular
In many cases, you want to change the validation rules depending on the state of the form or other conditions. The most popular
example of this is when you want to validate a field differently based on whether the user has submitted the form for the first time or not.

We support this through our `onDynamic` validation function.
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/guides/form-composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ As a result, while `form.Field` enables the most powerful and flexible usage of

The most powerful way to compose forms is to create custom form hooks. This allows you to create a form hook that is tailored to your application's needs, including pre-bound custom UI components and more.

At it's most basic, `createFormHook` is a function that takes a `fieldContext` and `formContext` and returns a `useAppForm` hook.
At its most basic, `createFormHook` is a function that takes a `fieldContext` and `formContext` and returns a `useAppForm` hook.

> This un-customized `useAppForm` hook is identical to `useForm`, but that will quickly change as we add more options to `createFormHook`.

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/guides/linked-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Link Two Form Fields Together

You may find yourself needing to link two fields together; when one is validated as another field's value has changed.
One such usage is when you have both a `password` and `confirm_password` field,
where you want to `confirm_password` to error out when `password`'s value does not match;
where you want `confirm_password` to error out when `password`'s value does not match;
regardless of which field triggered the value change.

Imagine the following userflow:
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/guides/listeners.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ We enable an easy method for debouncing your listeners by adding a `onChangeDebo

At a higher level, listeners are also available at the form level, allowing you access to the `onMount` and `onSubmit` events, and having `onChange` and `onBlur` propagated to all the form's children. Form-level listeners can also be debounced in the same way as previously discussed.

`onMount` and `onSubmit` listeners have to following props:
`onMount` and `onSubmit` listeners have the following props:

- `formApi`

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/react/guides/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: reactivity
title: Reactivity
---

Tanstack Form doesn't cause re-renders when interacting with the form. So you might find yourself trying to use a form or field state value without success.
TanStack Form doesn't cause re-renders when interacting with the form. So you might find yourself trying to use a form or field state value without success.

If you would like to access reactive values, you will need to subscribe to them using one of two methods: `useStore` or the `form.Subscribe` component.

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/react/guides/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Finally, we'll use `someAction` in our client-side form component.

import { useActionState } from 'react'
import {
initialFormState
initialFormState,
mergeForm,
useForm,
useStore,
Expand Down Expand Up @@ -412,7 +412,7 @@ Finally, the `action` will be called when the form submits.
import {
Form,
mergeForm,
useActionData
useActionData,
useForm,
useStore,
useTransform,
Expand Down
6 changes: 3 additions & 3 deletions docs/framework/react/guides/submission-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Submission handling
## Passing additional data to submission handling

You may have multiple types of submission behaviour, for example, going back to another page or staying on the form.
You can accomplish this by specifying the `onSubmitMeta` property. This meta data will be passed to the `onSubmit` function.
You can accomplish this by specifying the `onSubmitMeta` property. This metadata will be passed to the `onSubmit` function.

> Note: if `form.handleSubmit()` is called without metadata, it will use the provided default.

Expand Down Expand Up @@ -64,7 +64,7 @@ function App() {

## Transforming data with Standard Schemas

While Tanstack Form provides [Standard Schema support](./validation.md) for validation, it does not preserve the Schema's output data.
While TanStack Form provides [Standard Schema support](./validation.md) for validation, it does not preserve the Schema's output data.

The value passed to the `onSubmit` function will always be the input data. To receive the output data of a Standard Schema, parse it in the `onSubmit` function:

Expand All @@ -73,7 +73,7 @@ const schema = z.object({
age: z.string().transform((age) => Number(age)),
})

// Tanstack Form uses the input type of Standard Schemas
// TanStack Form uses the input type of Standard Schemas
const defaultValues: z.input<typeof schema> = {
age: '13',
}
Expand Down
8 changes: 4 additions & 4 deletions docs/framework/react/guides/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ At the core of TanStack Form's functionalities is the concept of validation. Tan

## When is validation performed?

It's up to you! The `<Field />` component accepts some callbacks as props such as `onChange` or `onBlur`. Those callbacks are passed the current value of the field, as well as the fieldAPI object, so that you can perform the validation. If you find a validation error, simply return the error message as string and it will be available in `field.state.meta.errors`.
It's up to you! The `<Field />` component accepts some callbacks as props such as `onChange` or `onBlur`. Those callbacks are passed the current value of the field, as well as the fieldAPI object, so that you can perform the validation. If you find a validation error, simply return the error message as a string and it will be available in `field.state.meta.errors`.

Here is an example:

Expand Down Expand Up @@ -104,7 +104,7 @@ So you can control when the validation is done by implementing the desired callb
</form.Field>
```

In the example above, we are validating different things on the same field at different times (at each keystroke and when blurring the field). Since `field.state.meta.errors` is an array, all the relevant errors at a given time are displayed. You can also use `field.state.meta.errorMap` to get errors based on _when_ the validation was done (onChange, onBlur etc...). More info about displaying errors below.
In the example above, we are validating different things on the same field at different times (at each keystroke and when blurring the field). Since `field.state.meta.errors` is an array, all the relevant errors at a given time are displayed. You can also use `field.state.meta.errorMap` to get errors based on _when_ the validation was done (onChange, onBlur etc.). More info about displaying errors below.

## Displaying Errors

Expand Down Expand Up @@ -152,7 +152,7 @@ Or use the `errorMap` property to access the specific error you're looking for:
</form.Field>
```

It's worth mentioning that our `errors` array and the `errorMap` matches the types returned by the validators. This means that:
It's worth mentioning that our `errors` array and the `errorMap` match the types returned by the validators. This means that:

```tsx
<form.Field
Expand Down Expand Up @@ -401,7 +401,7 @@ The synchronous validation method (`onBlur`) is run first and the asynchronous m

### Built-in Debouncing

While async calls are the way to go when validating against the database, running a network request on every keystroke is a good way to DDOS your database.
While async calls are the way to go when validating against the database, running a network request on every keystroke is a good way to DDoS your database.

Instead, we enable an easy method for debouncing your `async` calls by adding a single property:

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/solid/guides/async-initial-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function App() {
}))

return (
<Show when={!query.isLoading} fallback={<p>Loading..</p>}>
<Show when={!query.isLoading} fallback={<p>Loading...</p>}>
<></>
</Show>
)
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/solid/guides/devtools.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ id: devtools
title: Devtools
---

TanStack Form comes with a ready to go suit of devtools.
TanStack Form comes with a ready to go suite of devtools.

## Setup

Install the [TanStack Devtools](https://tanstack.com/devtools/latest/docs/quick-start) library and the [TanStack Form plugin](http://npmjs.com/package/@tanstack/solid-form-devtools), from the framework adapter that your working in (in this case `@tanstack/solid-devtools`, and `@tanstack/solid-form-devtools`).
Install the [TanStack Devtools](https://tanstack.com/devtools/latest/docs/quick-start) library and the [TanStack Form plugin](http://npmjs.com/package/@tanstack/solid-form-devtools), from the framework adapter that you're working in (in this case `@tanstack/solid-devtools`, and `@tanstack/solid-form-devtools`).

```bash
npm i @tanstack/solid-devtools
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/solid/guides/dynamic-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: dynamic-validation
title: Dynamic Validation
---

In many cases, you want to change the validation rules based depending on the state of the form or other conditions. The most popular
In many cases, you want to change the validation rules depending on the state of the form or other conditions. The most popular
example of this is when you want to validate a field differently based on whether the user has submitted the form for the first time or not.

We support this through our `onDynamic` validation function.
Expand Down
Loading