react-hook-form v7.6.0 Release Notes
Release Date: 2021-05-15 // almost 3 years ago-
🔄 Changed
- 0️⃣
useForm
willregister
missing inputs fromdefaultValues
const App = () => { const { register, handleSubmit } = useForm({ defaultValues: { test: { firstName: 'bill', lastName: 'luo' }, }, }); const onSubmit = (data) => { // missing registered input will be included console.log(data); // { test: { firstName: 'bill', lastName: 'luo' } } }; return ( <form onSubmit={handleSubmit(onSubmit)}> <input {...register('test.firstName')} /> <button /> </form> ); };
- 0️⃣