Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc. spelling updates #431

Merged
merged 1 commit into from
Feb 7, 2024
Merged
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/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- [useField](./api/react/useField.md)
- [useFormMetadata](./api/react/useFormMetadata.md)
- [useInputControl](./api/react/useInputControl.md)
- [FormPorvider](./api/react/FormProvider.md)
- [FormProvider](./api/react/FormProvider.md)
- [FormStateInput](./api/react/FormStateInput.md)
- [getFormProps](./api/react/getFormProps.md)
- [getFieldsetProps](./api/react/getFieldsetProps.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/react/FormProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The form context. It is created with [useForm](./useForm.md) and can be accessed

### FormProvider does not need to be a direct parent of the form

You are free to put your inputs anywhere outside of the form as long as they are associated through the [form attrbute](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#instance_properties_related_to_the_parent_form).
You are free to put your inputs anywhere outside of the form as long as they are associated through the [form attribute](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#instance_properties_related_to_the_parent_form).

```tsx
function Example() {
Expand Down
2 changes: 1 addition & 1 deletion docs/api/react/getCollectionProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The options of the collection. Each option will be treated as the value of the i

### `value`

The helper will retrun a **defaultValue** unless this is set to `false`, e.g. a controlled input.
The helper will return a **defaultValue** unless this is set to `false`, e.g. a controlled input.

### `ariaAttributes`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/react/getSelectProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Example() {

### `value`

The helper will retrun a **defaultValue** unless this is set to `false`, e.g. a controlled input.
The helper will return a **defaultValue** unless this is set to `false`, e.g. a controlled input.

### `ariaAttributes`

Expand Down
2 changes: 1 addition & 1 deletion docs/api/react/getTextareaProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Example() {

### `value`

The helper will retrun a **defaultValue** unless this is set to `false`, e.g. a controlled input.
The helper will return a **defaultValue** unless this is set to `false`, e.g. a controlled input.

### `ariaAttributes`

Expand Down
4 changes: 2 additions & 2 deletions docs/api/react/useForm.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ A function to be called before the form is submitted. If **onValidate** is set,

### `defaultNoValidate`

Enable constraint validation before the DOM is hydated. Default to **true**.
Enable constraint validation before the DOM is hydrated. Default to **true**.

## Tips

### Client validation is optional

Conform supports live validation (i.e. validate when the user leaves the input or types) without client validation. This is useful to avoid shipping the validation code in the client bundle. But please keep in mind of network latency and how frequently your users might hit the server esepecally if you are revalidating everytime they type.
Conform supports live validation (i.e. validate when the user leaves the input or types) without client validation. This is useful to avoid shipping the validation code in the client bundle. But please keep in mind network latency and how frequently your users might hit the server especially if you are revalidating every time they type.

### Automatic form reset when `id` is changed

Expand Down
2 changes: 1 addition & 1 deletion docs/api/react/useInputControl.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function Example() {

In the example above, we set up a hidden input manually instead of passing a `name` prop to the custom select component due to no control over the inner input rendered by the custom input. The input is visually hidden but still focusable thanks to the **sr-only** class from [tailwindcss](https://tailwindcss.com/docs/screen-readers#screen-reader-only-elements). When the input is focused, we delegate the focus to the custom input by calling `inputRef.current?.focus()`.

If you are not using tailwindcss, please look for a similiar utiltiy from your preferred styling solution or you can apply the following style based on the implementation of the **sr-only** class:
If you are not using tailwindcss, please look for a similar utility from your preferred styling solution or you can apply the following style based on the implementation of the **sr-only** class:

```tsx
const style = {
Expand Down
4 changes: 2 additions & 2 deletions docs/api/validitystate.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const submission = parse(formData, {
formatError,
});

// The error will be a dictinioary mapping input name to the corresponding errors
// The error will be a dictionary mapping input name to the corresponding errors
// e.g. { email: 'Email is required', password: 'Password is required' }
console.log(submission.error);

Expand Down Expand Up @@ -75,7 +75,7 @@ function formatError({ input }: FormatErrorArgs) {
error.push('Password is required');
}
if (input.validity.tooShort) {
error.push('Passowrd is too short');
error.push('Password is too short');
}
break;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/api/zod/conformZodMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This message is used to indicate that the validation is not defined and Conform

## Example

Here is a signup form example which validate if the email is unique.
Here is a signup form example which validates if the email is unique.

```tsx
import type { Intent } from '@conform-to/react';
Expand All @@ -24,7 +24,7 @@ import { z } from 'zod';

// Instead of sharing a schema, prepare a schema creator
function createSchema(
// The `intent` will be provieded by the `parseWithZod` helper
// The `intent` will be provided by the `parseWithZod` helper
intent: Intent | null,
options?: {
isEmailUnique: (email: string) => Promise<boolean>;
Expand Down
4 changes: 2 additions & 2 deletions docs/integration/ui-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ In this guide, we will show you how to integrate custom inputs with Conform.

## Event delegation

Conform supports all native inputs out of the box by attaching an **input** and **focusout** event listener on the document directly. There is no need to setup any event handlers on the `<input />`, `<select />` or `<textarea />` elements. The only requirment is to set a form **id** on the `<form />` element and make sure all the inputs have a **name** attribute set and are associated with the form either by using the [form](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#form) attribute or by nesting them inside the `<form />` element.
Conform supports all native inputs out of the box by attaching an **input** and **focusout** event listener on the document directly. There is no need to setup any event handlers on the `<input />`, `<select />` or `<textarea />` elements. The only requirement is to set a form **id** on the `<form />` element and make sure all the inputs have a **name** attribute set and are associated with the form either by using the [form](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#form) attribute or by nesting them inside the `<form />` element.

```tsx
function Example() {
Expand Down Expand Up @@ -153,7 +153,7 @@ function Example() {

## Simplify it with Form Context

You can also simplfy the wrapper component by using the [useField](../api/react/useField.md) hook with a [FormProvider](../api/react/FormProvider.md).
You can also simplify the wrapper component by using the [useField](../api/react/useField.md) hook with a [FormProvider](../api/react/FormProvider.md).

```tsx
import {
Expand Down
4 changes: 2 additions & 2 deletions docs/intent-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Product() {

## Form Controls

Conform utitlize the submission intent for all form controls, such as validating or removing a field. This is achieved by giving the buttons a reserved name with the intent serialized as the value. To simplify the setup, Conform provides a set of form control helpers, such as `form.validate`, `form.reset` or `form.insert`.
Conform utilizes the submission intent for all form controls, such as validating or removing a field. This is achieved by giving the buttons a reserved name with the intent serialized as the value. To simplify the setup, Conform provides a set of form control helpers, such as `form.validate`, `form.reset` or `form.insert`.

### Validate intent

Expand All @@ -64,7 +64,7 @@ function EmailForm() {
}
```

When the button is clicked, conform identify the serialized intent with the reserved name and trigger a validation by marking the email field as validated and returns the error message if the email is invalid.
When the button is clicked, conform identifies the serialized intent with the reserved name and trigger a validation by marking the email field as validated and returns the error message if the email is invalid.

However, if you want to trigger the validation once the user leaves the field, you can also trigger the validate intent directly.

Expand Down
2 changes: 1 addition & 1 deletion docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function action({ request }) {

// Client form component
export default function LoginForm() {
// Grap the last submission result if you have defined a server action handler
// Grab the last submission result if you have defined a server action handler
// This could be `useActionData()` or `useFormState()` depending on the framework
const lastResult = useActionResult();
const [form, fields] = useForm({
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tutorial

In this tutoiral, we will start with a basic contact form built with just Remix and Zod. Then, we will show you how to enhance it using Conform.
In this tutorial, we will start with a basic contact form built with just Remix and Zod. Then, we will show you how to enhance it using Conform.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/upgrading-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function Example() {
<form>
<ul>
{tasks.map((task) => {
// It is no longer necessary to define an addtional component
// It is no longer necessary to define an additional component
// with nested list as you can access the fieldset directly
const taskFields = task.getFieldset();

Expand Down
Loading