Skip to content

Commit

Permalink
Translate getYupConstraint.md via GitLocalize
Browse files Browse the repository at this point in the history
  • Loading branch information
coji committed Mar 2, 2024
1 parent b98777f commit ea9363c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/ja/api/yup/getYupConstraint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# getYupConstraint

Yupスキーマをイントロスペクトすることで、各フィールドの検証属性を含むオブジェクトを返すヘルパーです。

```tsx
const constraint = getYupConstraint(schema);
```

## パラメーター

### `schema`

イントロスペクトされるべき Yup スキーマです。

##

```tsx
import { getYupConstraint } from '@conform-to/yup';
import { useForm } from '@conform-to/react';
import * as yup from 'yup';

const schema = yup.object({
title: yup.string().required().min(5).max(20),
description: yup.string().optional().min(100).max(1000),
});

function Example() {
const [form, fields] = useForm({
constraint: getYupConstraint(schema),
});

// ...
}
```

0 comments on commit ea9363c

Please sign in to comment.