⚓️ feat: build-in form level validate (#13195) feat: build in form valdiate update max size update with input react to validate form update api update api fix type fix all the format issues update valdiation logic and add test remove only update validation logic to support event-based validation make prop name shorter and update validation fix tests and api contractor rename form error to form rename to valid minor clean up revert back function fix with early exit fix test fix type and contract update api lint update
⚓️ feat: build-in form level validate (#13195)
feat: build in form valdiate
update max size
update with input react to validate form
update api
fix type
fix all the format issues
update valdiation logic and add test
remove only
update validation logic to support event-based validation
make prop name shorter and update validation
fix tests and api contractor
rename form error to form
rename to valid
minor clean up
revert back function
fix with early exit
fix test
fix type and contract
lint update
Get started | API | Form Builder | FAQs | Examples
npm install react-hook-form
import { useForm } from 'react-hook-form'; function App() { const { register, handleSubmit, formState: { errors }, } = useForm(); return ( <form onSubmit={handleSubmit((data) => console.log(data))}> <input {...register('firstName')} /> <input {...register('lastName', { required: true })} /> {errors.lastName && <p>Last name is required.</p>} <input {...register('age', { pattern: /\d+/ })} /> {errors.age && <p>Please enter number for age.</p>} <input type="submit" /> </form> ); }
We’re incredibly grateful to these kind and generous sponsors for their support!
Thank you to our previous sponsors for your generous support!
Thanks go to all our backers! [Become a backer].
Thanks go to these wonderful people! [Become a contributor].
Documentation website supported and backed by Vercel
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
Get started | API | Form Builder | FAQs | Examples
Features
Install
Quickstart
Sponsors
We’re incredibly grateful to these kind and generous sponsors for their support!
Past Sponsors
Thank you to our previous sponsors for your generous support!
Backers
Thanks go to all our backers! [Become a backer].
Contributors
Thanks go to these wonderful people! [Become a contributor].
Documentation website supported and backed by Vercel