Skip to content

Latest commit

 

History

History
99 lines (76 loc) · 4.59 KB

README.ko-KR.md

File metadata and controls

99 lines (76 loc) · 4.59 KB

유연하고 확장 가능한 사용하기 쉬운 고성능 폼 검증 라이브러리

CircleCI npm downloads npm dep npm Coverage Status

Tweet Join the community on Spectrum

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

특징

  • 성능과 DX를 기반으로 구축
  • 제어되지 않는 양식 검증
  • 의존성 없는 작은 용량
  • HTML 표준을 따르는 검증
  • 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>
  );
}

기여자

모든 기여자 분들께 감사합니다. [기여 하기]

후원자

모둔 후원자 분들께 감사합니다 [후원 하기]