this post was submitted on 08 Mar 2023
3 points (80.0% liked)
Frontend Web Development
296 readers
2 users here now
Community to discuss stuff all things related to frontend web development. (sharing resources, discussion etc.)
founded 3 years ago
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I like the concept of React, but I find it's much more complex than it needs to be. A lot of the complexity comes from the fact that's not opinionated enough. For example, React is agnostic regarding what causes a render to happen, so now you have to manage the whole lifecycle as the user and decide whether the component should repaint or not.
There's a ClojureScript library called Reagent that uses React internally. However, it made the decision to use reactive atoms as the repainting mechanism. Components observe the state of the atom, and when it changes the component repaints. With this strategy you only have to care about the render portion of the lifecycle. To be fair, React hooks now work similarly to that.
Another approach I found interesting was HTMX where UI is basically treated as a dumb terminal and all the logic happens server side. I do find there is a lot of value in decoupling business logic from rendering by design.