DEV Community

Discussion on: Why would people hate React (or JSX), but not Vue SFC, or even Angular?

Collapse
 
austindd profile image
Austin

The only thing Angular has going for it IMO is that it's very opinionated in how you structure literally everything. That's fine, but it's very limiting, and sometimes you end up fighting the framework to do what you really want.

As for React, it's far less opinionated. In fact, it's not even a framework--it's just a library, so I don't really think the two are comparable.

As for the JSX soup problem, I think you can really chalk it up to a clash of paradigms and a lack of discipline.

React components should be very small, and only concern themselves with rendering the view on the page. That includes layout, data, and minimal logic (e.g. mapping a function over list items) required to render the correct view.

All of the business logic and technical bits like state management should live inside a higher-order function that wraps the component. The Angular equivalent of this is to have a "dumb component" with a service class to manage the business logic.

That's just a design pattern that people need to recognize and use, just like we have design patterns in Angular. It's just that React doesn't generate boilerplate code to enforce design patterns like Angular's CLI does. To me, that's a good thing, and I'm not alone in that belief. But it does open up more opportunities for programmers to do idiotic things.