3 ms·
To me, the killer feature of React is how easy it is to mix with standard "vanilla" JS libraries. The "React" version of a library is usually a fairly trivial w
by nicoburns 6y ago
To me, the killer feature of React is how easy it is to mix with standard "vanilla" JS libraries. The "React" version of a library is usually a fairly trivial wrapper around the "normal" version. In contrast, integrating with Angular is a lot more involved and is in effect its own ecosystem.
The other thing I can't stand about Angular is that it puts its proprietary templating language "in control" of components. Which means if you want to do something more complicated that isn't implemented in the templating language, then you just can't (or you end up fighting the framework). With React, it's as if the equivalent of Angular's controllers (components? - it's been a while since I used Angular) were in control. The templating is only for templating.
FWIW, I agree on the ternary operator issue. Although IMO this is actually a deficiency in JavaScript rather than in React/JSX: If if-else and switch in JavaScript were expressions then this problem would disappear completely.
- jiofih 6y agoCan you provide some examples? My experience is that almost any library you end up using is built specifically for React and not vanilla.
- enumjorge 6y agoRedux can be used in projects unrelated to React.
- rejschaap 6y agoI have used react-sortablejs and react-leaflet in the past. I don't have any experience actually wrapping existing libraries myself though. https://github.com/SortableJS/react-sortablejs https://github.com/SortableJS/react-sortablejs https://react-leaflet.js.org/ https://react-leaflet.js.org/
- nicoburns 6y agoCompare https://github.com/nhagen/react-intercom/blob/master/src/index.js https://github.com/nhagen/react-intercom/blob/master/src/ind... with https://github.com/PatrickJS/angular-intercom/blob/master/angular-intercom.js https://github.com/PatrickJS/angular-intercom/blob/master/an... And that's the small one. There's also https://github.com/CaliStyle/ng-intercom https://github.com/CaliStyle/ng-intercom As another example, consider HTTP. Angular provides its own special HTTP class. With React I just use the standard Fetch API.