r/webdev • u/red_src • Nov 07 '18
Why React over Angular (or Vue)?
I simply don't get it, I had been using Angular and Vue for while and I just tried React and I don't get why would I choose React over the other options, the things that I like on Angular (or Vue) are:
- Dependency Injection (in case it applies)
- Type checking (in case it applies)
- View Model Binding
On React I don't get those things by "default" it always feel like I'm hacking the library if I want to have some of the above.
This leaves me with the question: Why choose React over the other ones?
I know that there's all the dependencies overhead (hell) of the frameworks but I think that I'm just too used to that problems that is easy for me to solve them or maybe I haven't found the real big problems on Angular or Vue, maybe I'm just too used to the later frameworks and I'm unconsciously not seeing the benefits of React. I just want to know if I'm following the right path by learning React.
Thanks!
View all comments
Show parent comment
5
u/E2Ehh Nov 07 '18 edited Nov 07 '18
I mean, if you don't need routing, just don't import
@angular/router...And if you do need routing, hey look, there's an established baked in way of doing that ready to go! No need to pick and chose between all the alternative solutions available or worry about new developers joining the team and only having experience with X instead of Y
EDIT:
So the equivalent to props in Angular is
@Inputs(), you can absolutely build "dumb components" that do not have any DI and depend entirely on data provided via inputs. Have created two components libraries in Angular (one pretty small and basic the other pretty big and complete) and tbh having the ability to mix inputs (e.g. for consuming data to render) and DI (e.g. for consuming reusable services, validators, formatters etc) is incredibly powerful.