4 ms·
How to Build Forms in React
- latchkey 4y agoBuilding forms in React is a pain in the ass and requires a lot of little details with strange edge cases. I built a simple wrapper between two popular libraries, MUI and React Final Form called aptly mui-rff [1]. I've been maintaining this library for years now. It gets ~40k downloads a month off of NPM. It still isn't perfect, some of the widgets have weird edgecase failures. It took a long time to get it to the point where it is now. The saving grace over time has been that I wrote a decent amount of unit tests right from the start. This has thankfully allowed me to upgrade the library safely over time but wow... just wow... I've spent so much time just fixing things that break because of random bits of code rot. The fact that this is a ~10 page blog post and still doesn't cover all the edge cases says so much about what is wrong with React and forms. It shouldn't be this hard. [1] https://github.com/lookfirst/mui-rff https://github.com/lookfirst/mui-rff
- vips7L 4y agoJust use Formik and save yourself the pain!