Hello everyone today, i will be starting another series for Form handling in React. We are going to use some libraries like formik, yup, tailwindcs...
For further actions, you may consider blocking this person and/or reporting abuse
What I learnt from Formik is that we can implement basic level of form handling with native approach and that should be used but when we encounter complex form handling and validations, Formik could help, and also in my code example I have used Formik hook to implement the functionalities, in later part of series, i will reduce the boiler plate and implement same thing with Formik Components with Almost 50 lines of code for this entire approach including UI, Logic, validation, and Form submitting
Formik is itself created to handle the forms with less headache and more fastly
Also in later part of the series, I will show some examples, how formik can handle complex validations with less line of code and implementation is also smooth, if we try to implement those functionalities on our own, it will take time and more lines of code
And I think Formik does the same thing behind the scenes which we implement natively
Appreciate your efforts in building this, I do not mean to be disrespectful in any way.
As of 2023, Formik has been deprecated due to a ton of reasons including lack of features (as listed out by @lukeshiru above) and updated security yet the title makes a bold claim of calling it the "best library for forms", I am not sure why this blog was allowed to posted in the first place considering this is one of the best platforms for web dev.
Organizations have already migrated to react hook form and use of Formik is discouraged by any means.
Ref Link for discussion on their GitHub where the maintainers themselves have called it a day for Formik.
Well I think I can migrate this same code to React hooks form as the syntax is little bit different but rest is same, but just a question for validation part, Yup is good to use or it also has some alternative?
Those are the very specific cases and I checked Formik outputs, it does the same thing as we do with vanilla behind the scenes, Apart from that, We use React which uses JS everywhere, so, that also applies to React that we have Javascript so why use React, To save time and writing same logics again in javascript that react can do for us, same with Formik, it somehow helps in doing those things for us behind the scenes which we might do with vanilla approach and also formik and Yup is created specifically for form handling use cases to save time writing the logic and UI completely,
But I also use Vanilla thing for handling pretty much all the stuffs in React and Next JS, It's just in some places Formik can help us handling form efficiently and with less headache for thinking about logics
Well I think I am not at the level to see the differences you are mentioning here, i think I have to practice more and need more time to learn these things
ππ
@lukeshiru has literally listed out a ton of flaws/drawbacks which just shows the surface of Formik limitations, if someone just does 10 minutes of research, they can see why Formik should be avoided in 2023 and why react hook forms is a successor to it!
I checked but I saw React hooks has also limitation, it just it is a latest one to handle forms so it is still in use, Formik is kind of depreciated
I was planning to create 8-10 blogs but I will wrap up the series in the part
ππ
Thanks @lukeshiru and @jimivi8846
For explaining the stuff , drawbacks and alternatives ππ
Yes it is possible but will cover that later in the series
is it possible to have custom validation on a specific field?