5 ms·
Complex Forms are a solved problem within React, but it is not _standard_ so there are tons of competing implementations (from hand-rolling your own and relying
by DanielHB 3y ago
Complex Forms are a solved problem within React, but it is not _standard_ so there are tons of competing implementations (from hand-rolling your own and relying mostly to a bunch of libraries that manage all sorts of things for you like touched state, validation and submission)
Some of these competing implementations are meant to make very complex forms feasible, but they are not standard. Being not standard makes the cognitive load a lot higher to bring them into your project. People might not know the lib you use, they might argue it is overkill, they might want to swap it out for their own pet library, since it is not widely used it might have more bugs...
So what we actually need is better raw base elements in HTML. For forms, more powerful elements/attributes that allow you to keep them non-controlled in React. If they were better we wouldn't need so much tooling on top of it and applications would behave more similarly to each other. In short, better standardisation means less cognitive load.
There is a reason why JS is getting so popular in backend and mobile apps. It is because it is _less_ cognitive load for your team because your web frontend already needs to use it.
Now replace Forms with DatePickers, (Multi)Select, Menus, Popups, etc. Popups are actually becoming standard though:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di...
And suddenly dozens of libraries die in agonising cleansing fire.