Skip to content

Commit

Permalink
Merge pull request #36 from coji/gitlocalize-28574
Browse files Browse the repository at this point in the history
getYupConstraint.md translated to Japanese.
  • Loading branch information
coji authored Mar 2, 2024
2 parents 1a48710 + ea9363c commit 4384ff0
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 4384ff0

Please sign in to comment.