top | item 14307660

Why is React is taking over front-end development?

37 points| lucaspiller | 9 years ago |medium.freecodecamp.com | reply

59 comments

order
[+] robotnoises|9 years ago|reply
"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.

[+] boubiyeah|9 years ago|reply
I've never seen someone being productive with react in a few hours, unless we're talking about very basic, static layouts.

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.

[+] sheeshkebab|9 years ago|reply
Let's not kid ourselves - React is not jquery, by a long stretch. There is a reason why react developers can charge $100hr+ to do things effectively with react.

"Hello world" in react is deceptively easy, that is true.

[+] robodale|9 years ago|reply
I'd argue Vuejs is rocketing toward Reacts leadership position: https://trends.google.com/trends/explore?q=reactjs,vuejs
[+] enraged_camel|9 years ago|reply
Vuejs is very good, and I like it a lot more than React. However, it is difficult to see it ever becoming more popular than React, when the latter is evangelized by a large and well-known software company.
[+] maelito|9 years ago|reply
Isn't it misleading to use 'ReactJs' in google trends ? You won't find 'ReactJs' on React's homepage, but 'React' whereas you'll find 'AngularJs' and 'VueJs' everywhere on their respective home.
[+] Kiro|9 years ago|reply
How is Vue different from Angular 1? It looks and feels very similar. Granted, I haven't built very large applications but I'm using it in production and I don't really see the benefit while React has a completely different take.
[+] j_m_b|9 years ago|reply
> React is a JavaScript library. It’s not a framework.

This is an extension of the UNIX philosophy: do one thing, right. React developers state that "React is the V in the MVP model". React can easily be integrated with any other JS library that is out there. This is very attractive to developers.

Facebook in general seems to be moving in the functional programming direction with tools like GraphQL. React is a functional approach to UI development. It also makes use of the concept of immutable data. The functional programming paradigm has been gaining traction lately and React seems to be riding along with this wave.

As React is functional, simple and makes use of immutable data, it was quickly adopted by the Clojure community. It has two major adaptations, React and Om. I imagine other functional programming groups have gone in a similar direction. This also could be helping propel it along.

[+] crimsonalucard|9 years ago|reply
Does the unix philosophy require web pack and a complex compiler tool chain to get it to work? Is Compiling one language into another part of the philosophy as well?

React is not functional.

[+] ChrisCinelli|9 years ago|reply
React came with a nice and small interface that work well with the DOM. It was pretty innovative and solved one of the biggest pain points.

I agree that because it just works on the View, it has been easy for people to adopt it.

The support of Facebook helped to make it shine in the "a new frontend framework a month" reality. Now the great documentation, great articles and great component already built for you make React a very compelling piece of software to use.

At the same time I agree with who says that today if we look only at the simplicity of the interface and performance, there are a few better libraries.

MarkoJs and Vue for example.

[+] seangates|9 years ago|reply
+1 for MarkoJS. Approachable, isomorphic, stateful, and FAST.
[+] hjnilsson|9 years ago|reply
Is it? Google Trends shows about twice the interest for Angular vs React [1], which is not an insignificant difference. Is there strong evidence to indicate that React is 'taking over'?

[1] https://trends.google.com/trends/explore?q=%2Fm%2F0j45p7w,%2...

[+] skeeterbug|9 years ago|reply
If you have a simple, well documented library, is there a reason to search on it as often?
[+] reboog711|9 years ago|reply
Search for UI Developer job with a distributed / remote team; and React jobs are significantly easier to come by.

Granted, by limiting to distributed / remote teams may not be indicative of the whole market.

[+] nilved|9 years ago|reply
A lot of those posts are probably "Angular is dead" or "React is better than Angular"
[+] hypercluster|9 years ago|reply
Okay I go ahead and say it: I still like Angular 1.x

I feel like there's a lot of hate towards Angular and much praise for React. Personally I don't get along with the syntax and just the readability of React code or rather the structure. But that may just be my lack of experience with it.

I understand that the DOM diffing in React is superior but.. is it really that important? For me the two-way data binding of Angular takes away the headaches of doing updates with jQuery. Sure, I get that having to follow the "Angular" way and wrapping foreign libraries is overhead. But it still feels adequately simple to write applications with it.

[+] samsonradu|9 years ago|reply
> 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.

This is a valid point. Maybe not a few hours but it clicks with developers after a few days. But then there is also the very good documentation and an already big community. Also Facebook backing it is encouraging for mid-sized companies to use, which don't expect breaking changes any time soon.

[+] hyperpallium|9 years ago|reply
Because every few months, something takes over web developement.
[+] pmarreck|9 years ago|reply
See: why I went to the backend.

Things are more static, and more easily automated-testable.

[+] awjr|9 years ago|reply
I think the title is slightly wrong. "Why is React better than plain JavaScript DOM manipulation?" might be a better title.

I was hoping for a more indepth analysis of industry trends around different JS UI frameworks.

[+] crimsonalucard|9 years ago|reply
There is rarely a logical reason for why something is taking over front-end development.

Take javascript for example. Let's face it... javascript is a shit language. Why did it take over front end web development? Because of Logic? No. Why did React take over front end web development? Because of Logic? Maybe.

The react + redux ecosystem has major issues that need to be addressed.

Problem #1: complex tool chain.

Problem #2: Forced OOP. Components need to be objects to use this.setState(). Why is this design necessary? See cycle.js.

Problem #3: redux... functional programming / immutable programming is not necessarily the best choice for a Model in any architecture that contains a model (MVC). Try building an app with a complex tree structure for the model then update a node in the middle of that tree and see what immutability does for you... Welcome to the world of Zippers and lenses..

In fact View components should be immutable and the model itself should be mutable... In react + redux it's the other way around!

We can do better. React + redux are not the holy grail.

[+] crimsonalucard|9 years ago|reply
Just want to mention. Does it make sense for a model in the backend to be immutable? Imagine that... Immuteable mysql... Why does this make sense on the front end? Why? Why? Why?
[+] sebringj|9 years ago|reply
My perspective is React was always very simple and I use React Native and React so it is easy to transition between them. My focus then becomes on getting actual things done.
[+] acdha|9 years ago|reply
“React is just JavaScript”

That's like saying Windows is just C/C# – it's technically somewhat true but over-simplified to the point of being useless.

[+] dowrow|9 years ago|reply
Vue < React < Angular Hacky micro-frameworks are not the way to go for big, serious, retro-compatible apps developed by big distributed teams.
[+] tchaffee|9 years ago|reply
Does Vue allow you to use only javascript like React does? After getting over my initial resistance of using javascript as my "templating language" I am kind of done with frameworks that try to make HTML into a programmable language.