install react hook form
npm install react-hook-form
npm install react-hook-formimport 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> );}
Also in C++:
- set pin on mcp23017 using raspberry pi shell
- gsap install
- react-scripts is not recognized as an internal command windows
- install guake ubuntu
- install discord in ubunut
- pm2 install
- mongo shell console log
- scan and print all keys redis shell
- pip install apache beam
- Lock the screen powershell
- scp copy
- vue cli
- how can I check the memory of computer in ubuntu
- uninstall react native package
- download clamav ubuntu 20
- how to delete a file in linux
- react icons
- install lutris ubuntu
- linux remove null bytes from file
- linux nano editor
- how to see branches git cmd
- javascript implements
- git add identity
- how to update node in ubuntu 18.04