chuanhao01 / oes-rsfg

OES Report Sick Format Generator (OES-RSFG)
https://chuanhao01.github.io/oes-rsfg/
MIT License
0 stars 0 forks source link

Change over from Formik to react-hook-forms #1

Open chuanhao01 opened 1 year ago

chuanhao01 commented 1 year ago

Seems like it would be better in simple scenarios? But for complex and preventing boilerplate, using formik might be good But it requires a lot of mental gymnastics

https://react-hook-form.com/

chuanhao01 commented 1 year ago

Also it is not being actively maintained Last release 2 yrs ago Last commit 1 yr ago

chuanhao01 commented 1 year ago

Also for complex forms, seems like in react-hook-form You should break down the form into smaller sub-forms, passing on the prop to create the default store Each sub-form logic should be isloated But the default state and store can be in a parent and passed down

The main form should contain the data (DRY) then the smaller sub-forms handle whatever custom logic is needed This way the store passed down can get back the values?

Right now, where the form value is defined and how I know I have this value is in 2 different places