Skip to content

Latest commit

 

History

History
103 lines (77 loc) · 4.77 KB

README.es-ES.md

File metadata and controls

103 lines (77 loc) · 4.77 KB

Formas performantes, flexibles y extensibles con validación fácil de usar.

CircleCI npm downloads npm dep npm Coverage Status

Tweet Join the community on Spectrum

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

Caracteristicas

  • Construido con rendimiento y DX en mente
  • Adopte la validación de forma no controlada
  • Mejora el rendimiento de formularios controlados
  • Tiny size sin ninguna dependencia
  • Sigue el estándar HTML para la validación
  • Compatible con React Native
  • Supports Yup validación basada en esquemas
  • Admite la validación del navegador nativo
  • Cree formularios rápidamente con el form builder

Instalación

$ npm install react-hook-form

Enlaces

Inicio rápido

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

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

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input name="firstname" ref={register} /> {/* registrar una entrada */}

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

Backers

¡Gracias a todos nuestros patrocinadores! [Hazte patrocinador].

Contributors

Gracias a estas personas maravillosas. [Hazte colaborador].