Written by Siegfried Grimbeek✏️
Introduction
As JavaScript developers, we are all aware of the complexities and intricacies that we may...
For further actions, you may consider blocking this person and/or reporting abuse
Hey Justin,
as promised :) we have a new custom hook for Field Array.
react-hook-form.com/api#useFieldArray
example below:
So, did you test Formik 2 or the old one. Formik has had a rc out for a long time that was just released. Also for the performance tests, did you use fast field or just the field component? Would be nice to see the actual code you set up for the render tests as well, to know exactly how it was tested :) It seems you have the default
validateOnChange
setting, which istrue
.Hey Justin,
Thanks very much for your feedback, which I am 100% agree :) I think there are few things which I was try to highlight in the demo:
onChange
which trigger render at the root of your app (not sure if you notice the render counter on the top right)but this is not the end of it, I am going to upload the example to the website and when I get some more free time, I can work on an abstract version of Field Array, which basically cooks that logic into the small component
RHFArrayField
. I will get to it, just matter of time :)again much appreciated your feedback and time to looking into it.
cheer
bill
hey Justin, author of react hook form here, wondering how can we improve the experience here? let me know your feedback. In case you didn't see this section: react-hook-form.com/advanced-usage...
cheers
bill
Hey! Really cool article and definitely I'm going to play with the React Hook Form library :)
One notice - in the table with summary for performance comparison in cell representing re-renders for React Hook Form probably should be
3
instead of316,797
.thanks, Piotr, feedback welcome after you trying :)
Thanks for the feedback! I think I do lack a good example of doing Field Array, which I should :). The lib itself doesn't expose any of those utility functions which you have mentioned and it's my purpose, I would prefer users to compose and work off their own logic and keep the API primitive. To work with react-hook-form with Field array, you need to maintain your own state to generate the fields and use the 'name' attribute as your name of the data source. I will be working on a good example and upload the website soon.
Inability to work with Form? I'm using React, since years, and I always work with Forms by myself...
Every now and then, a new React Form Library emerges that supposed to be the "best".
Before it was Redux-Forms, now is Formik, next is.... you get the point!
Only time will tell.
This is a bug. Thanks for reporting the issue. I have resolved the problem. let me know if there is still an issue.
cheers
bill
Here is the example which i have built: codesandbox.io/s/react-hook-form-f... let me know what do you think :)