|
|
|
|
|
by robotnoises
3333 days ago
|
|
"React is just JavaScript, there is a very small API to learn, just a few functions and how to use them. After that, your JavaScript skills are what make you a better React developer. There are no barriers to entry. A JavaScript developer can become a productive React developer in a few hours." To me, this is the major driver of React's adoption and thus its success. Angular 1 took me a while to grok because there were so many moving parts. React's API is small and consistent a la JQuery, with the added bonus of being incredibly powerful. |
|
Stateful components are still hard to write (but are useful!).
Component lifecycle is not trivial and has many traps.
Newcomers put the craziest things in render(): side effects, etc. JS or even TS has no way to enforce that render should just return a VNode and do nothing else.
Data management is very, very difficult (beginners use props and state interchangeably).
Using higher order components or generally writing reusable components with clean APIs is an art in itself.
Separation of concerns in React is tricky too, as the community like to say "everything is a component" and this again has many traps.
The concept of keys or in general, when a node is reused vs when it's destroyed/recreated is not easily understood by newcomers too. But you HAVE to understand that to do animations, etc.
Also, you're productive if you don't care about performances; Once you do, you will be much slower. shouldComponentUpdate, using immutable updates everywhere, not creating lambdas everywhere on each render (idiomatic react), using virtualized lists, etc.
Let's not pretend React is very easy. It only is fairly easy if you compare it to something extremely bloated like angular.