Skip to content

Latest commit

 

History

History
98 lines (75 loc) · 4.78 KB

README.ja-JP.md

File metadata and controls

98 lines (75 loc) · 4.78 KB

高性能で柔軟かつ拡張可能な使いやすいフォームバリデーションライブラリ。

CircleCI npm downloads npm dep npm Coverage Status

Tweet Join the community on Spectrum

🇦🇺English | 🇨🇳 简体中文 | 🇯🇵 日本語 | 🇰🇷한국어 | 🇫🇷Français | 🇮🇹Italiano | 🇧🇷Português | 🇪🇸Español | 🇷🇺Русский

特徴

  • パフォーマンスと DX を念頭に構築
  • 非制御フォームバリデーション
  • 依存関係のない小さなサイズ
  • React Native との互換性
  • Yup スキーマベースのバリデーションをサポート
  • ブラウザのネイティブバリデーションをサポート
  • Form Builder でフォームを素早く作成

インストール

$ npm install react-hook-form

リンク集

クイックスタート

import React from 'react';
import { useForm } from 'react-hook-form';

function App() {
  const { register, handleSubmit, errors } = useForm(); // initialise the hook
  const onSubmit = data => {
    console.log(data);
  };

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input name="firstname" ref={register} /> {/* register an input */}
      <input name="lastname" ref={register({ required: true })} />
      {errors.lastname && 'Last name is required.'}
      <input name="age" ref={register({ pattern: /\d+/ })} />
      {errors.age && 'Please enter number for age.'}
      <input type="submit" />
    </form>
  );
}

コントリビューター

これらの素晴らしい人々に感謝します。[コントリビューターになる]

スポンサー

全てのスポンサーに感謝します! [スポンサーになる]