HACKER Q&A
📣 zizee

Is React a good idea for simple web forms?


At work we run a mostly RoR monolith, but are slowly introducing TypeScript backends for new capabilities. We're mostly doing this because hiring for Ruby devs is proving very difficult in our geography (Australia). The older UI code was mostly Rails templates (slim), Styled Bootstrap, and a hodgepodge of JQuery for some in browser responsiveness/interactivity.

My history at work was as an early engineer, helping building a lot of the original system. I am very comfortable in Ruby/Rails, and to a lesser extent in the front end using "old school" tech (such as the aforementioned bootstrap/jquery). I now act in an architect role, with my day to day revolving less around the code, more advising on the higher level stuff helping to advise tech direction. Our team is about 40 engineers strong, without a strong back-end/front-end divide in responsibilities.

We have selected React/Tailwind for building our more complex and interactive parts of our application. It's definitely better than the organically grown JQuery stuff. More structured, more opinionated, easier to test. I think this is a real step forward.

Lately people are wanting to start using React to do the "boring" parts of our UI. i.e. the myriad of rarely visited settings forms for all the different features of our system. To create these forms it used to be a simple matter of creating data model, the controller for crud actions, and defining some server side templates. Now it seems a lot more involved. You need everything that was required for SSR, but now you need to be more explicit in defining an API build pipelines, managing your dependencies, and a lot more code.

I am concerned that people are greatly over-complicating things, and that simple server side rendering is a much better fit for these simple screens people are putting together. But I also might be just out of touch, and the benefits that we see in our more complex workflow screens are worth having in our simple crud forms, and a single way of doing UIs is worth it. A third option is that our tooling isn't as good as it should be, that we're not doing it right, and with a few tweaks React is just as quick and easy as the ol' "rails generate" experience.

Anyhow, I am curious to know people's experiences. Is React a smart idea for boring forms? Do you find the experience as quick/easy as a SSR framework? How about maintainability? Is it expensive up front, but is easier to maintain long-term? Or is there more maintenance than SSR long term?


  👤 PaulHoule Accepted Answer ✓
No. Unless you need animation or some interface which is more more complex than can be easily done with SSR, React is a boondoggle.

I was writing SPAs that did really complex things around 2005-2010 including things like knowledge graph editors and geospatial decision support software. Back then there was no async/await and almost no knowledge about how to make such things and it was a struggle to figure this stuff out and communicate it to clients, management and other devs. Frequently I'd get on a project that was a "big ball of mud" and going nowhere and whip it into shape.

People are still writing SPAs that do very complex things such as Figma today, but mostly people write very complex SPAs that do very simple things and I find frameworks like React, Redux, Vue, etc. to be mostly a disappointment.

I write a lot of React at work and feel mostly on top of things, I like how it is straightforward to write things that look and work like desktop apps, but working on my own account I write applications a lot like RoR apps. My "server" is a very powerful desktop computer that is underloaded and the speed is unlike anything in the industry. There are no spinners! Responsiveness is like a desktop app on a fast network and still good on a slow network. There is none of the initial waiting to load that you have with a desktop or React app. I am learning how to use

https://htmx.org/

to get even better speed, D3.js for interactive graphics, but I'm still looking for a systematic approach to CSS that I really like.