Back to React Hook Form

README.Zh TW

docs/README.zh-TW.md

7.75.05.0 KB
Original Source
<div align="center"> <p align="center"> <a href="https://react-hook-form.com/zh" title="React Hook Form - Simple React forms validation">
  </a>
</p>
</div> <div align="center">

高效能、靈活、易擴充、易於使用的表單

 

</div> <div align="center"><p align="center"><a href="https://react-hook-form.com/zh" title="React Hook Form - Simple React forms validation"></a></p></div>

<a href="./README.V6.md">English</a> | 繁中 | <a href="./README.zh-CN.md">簡中</a> | <a href="./README.ja-JP.md">日本語</a> | <a href="./README.ko-KR.md">한국어</a> | <a href="./README.fr-FR.md">Français</a> | <a href="./README.it-IT.md">Italiano</a> | <a href="./README.pt-BR.md">Português</a> | <a href="./README.es-ES.md">Español</a> | <a href="./README.ru-RU.md">Русский</a> | <a href="./README.de-DE.md">Deutsch</a> | <a href="./README.tr-TR.md">Türkçe</a>

功能

安裝

$ npm install react-hook-form

連結

快速開始

jsx
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} />
      <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>
  );
}

贊助者

<a href="https://underbelly.is/" target="_blank"> </a>

想在這裡秀你的 Logo 嗎?在 Twitter 上私訊我

支持者

感謝所有支持者! [成為支持者]

<a href="https://opencollective.com/react-hook-form#backers"> </a>

組織機構

感謝這些優質的組織! [捐助]

<a href="https://github.com/react-hook-form/react-hook-form/graphs/contributors"> </a>

貢獻者

感謝這些出色的人! [成為貢獻者]

<a href="https://github.com/react-hook-form/react-hook-form/graphs/contributors"> </a>