|
Download react-hook-form/docs/README.V7.ja-JP.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 11.9 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/docs/README.V7.ja-JP.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/docs/README.V7.ja-JP.md
-
curl -L -o README.V7.ja-JP.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/docs/README.V7.ja-JP.md
11.9 kB
Version 7 | Version 6(日本語)
特徴
- パフォーマンスと UX/DX を念頭に構築
- 非制御フォームバリデーション
- UIライブラリと統合し、すぐに利用が可能
- 依存関係がなく、小さいサイズ
- ブラウザのネイティブバリデーションをサポート
- Yup, Zod, Superstruct, Joi, Vest, class-validator, io-ts, nope また custom をサポート
インストール
npm install react-hook-form
リンク集
Quickstart
import React from 'react';
import { useForm } from 'react-hook-form';
function App() {
const {
register,
handleSubmit,
formState: { errors },
} = useForm();
const onSubmit = (data) => console.log(data);
return (
<form onSubmit={handleSubmit(onSubmit)}>
<input {...register('firstName')} /> {/* register an input */}
<input {...register('lastName', { required: true })} />
{errors.lastName && <p>Last name is required.</p>}
<input {...register('age', { pattern: /\d+/ })} />
{errors.age && <p>Please enter number for age.</p>}
<input type="submit" />
</form>
);
}
スポンサー
親切で素敵なスポンサー(個人/企業)に感謝します!
支持者(後援者)
すべての支援者(後援者)に感謝します! [支持者(後援者)になる].
組織
素晴らしい組織に感謝します! [貢献する].
コントリビューター
素晴らしいコントリビューターに感謝します! [コントリビューターになる].