Skip to content

Latest commit

 

History

History
109 lines (81 loc) · 5.29 KB

README.de-DE.md

File metadata and controls

109 lines (81 loc) · 5.29 KB

Schnellladende, flexible und erweiterbare Formulare mit benutzerfreundlicher Eingabeprüfung

npm downloads npm npm Coverage Status

Tweet Join the community on Spectrum

English | 繁中 | 简中 | 日本語 | 한국어 | Français | Italiano | Português | Español | Русский | Deutsch | Türkçe

Eigenschaften

Installation

npm install react-hook-form

Weitere Information

Schneller Einstieg

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

Sponsoren

Möchten sie Ihr Logo hier? Direktnachricht mit Twitter

Unterstützer

Vielen Dank an alle unsere Unterstützer! [Werde auch ein Unterstützer].

Organisationen

Unser Dank geht auch an folgende wundervolle Organisationen! [Spenden].

Kontributoren

Unser Dank geht auch an folgende wundervolle Personen! [Werde auch ein Kontributor].