DEV Community

SavagePixie
SavagePixie

Posted on

Why do you like or dislike React?

I have recently been learning about React, which, as you probably know is a JavaScript library. As far as I understand it, one of its greater strengths is that it works with a virtual DOM, which makes updating the real DOM faster. If you google it, you'll find lots of reasons to use it as well as reasons not to use it.

What is your take on React? Do you like it? Do you find it too big? Does it perform well? What are your reasons for using it or not using it?

Top comments (14)

Collapse
 
blindfish3 profile image
Ben Calder

I use React professionally; but am happy enough switching between frameworks.

Likes:

  • easy enough to learn
  • component based
  • good employment prospects
  • powerful backing: it's going to be around for a while I guess
  • plenty of support/instructions available
  • flexible
  • available libraries
  • well established

Dislikes:

  • JSX: conditional output can sometimes feel clunky compared to a template-based approach; though Array.map(renderElement) is some consolation
  • state management - usually requires additional libraries like redux (the counterpoint to flexibility is that you have to do extra work yourself and everyone has a different idea of the best approach)
  • boilerplate (especially with redux)
  • payload: you have to ship the framework in your bundle
  • virtual DOM solves a problem that shouldn't be there (see Svelte below)
  • Accessibility (more an issue of how it gets used of course)
  • powerful backing isn't always a good thing: facebook aren't getting very good press in terms of their ethics lately
  • almost too popular: reduced competition can lead to stagnation and complacency. Too much noise when searching for solutions/libraries etc.

Alternatives:

  • Angular. More complete in that it provides structure for state management and an opinionated framework for adding things like services: less to think about; but less flexible and more to learn. Well established and backed by Google
  • Vue. I haven't used it but have heard good things. Seems to hit the sweet spot between React's flexibility whilst still providing a bit more structure
  • Svelte. Not yet properly established but pretty revolutionary: dispenses with the virtual DOM by compiling the framework functionality into the output. Achieves really good performance whilst keeping a comparatively tiny bundle size. Also has a really nice developer experience. I'd totally recommend it for small personal projects or as a more straightforward introduction to component-based frameworks. In the long term it still has to prove whether it works well at scale.
Collapse
 
savagepixie profile image
SavagePixie

Thanks for your comment. I share several of your likes and dislikes.

You have intrigued me with Svelte. I'll have to add it to my list.

Collapse
 
avalander profile image
Avalander

I do like React's idea of using a virtual DOM, and it really simplifies frequent and complex state updates to the DOM. Being able to just drop in how the DOM should look like based on the current state, instead of having to manually figure out what needs to be updated when, and having the library only update the relevant parts of the DOM, makes developing web apps considerably easier.

I'm not a big fan of stateful components, though. I prefer working with hyperapp, which is similar to using React + Redux minus all the boilerplate. Either that, or I use a pure virtual DOM library* (like superfine or snabbdom) and roll my own state management.

* By pure virtual DOM library I mean a library that only does virtual DOM, not a library free of side effects. React nowadays has a lot of state and event management built in.

Collapse
 
avalander profile image
Avalander • Edited

By the way, I've read the second article you linked and it is so wrong I don't even know where to start.

Collapse
 
critchkn profile image
Andrew Elliott

So far, I love it. It's relatively easy to pick up, its slick, loads fast and has been a great experience so far.

Plus, its in HIGH demand so I'm all about React right now

Collapse
 
savagepixie profile image
SavagePixie

Other than being easy to pick up, what would you say is its greatest strength?

Collapse
 
dance2die profile image
Sung M. Kim

I don't know much about Vue or Angular thus instead of technical aspect, I find that the large community is an advantage.

That means you can learn and get supports from other developers fairly quickly.

A larger doesn't necessarily translate to such a behavior but I found the React community very vibrant and supportive of each other.

Thread Thread
 
savagepixie profile image
SavagePixie

That's true. Supportive communities and proper documentation are good assets for any library.

Collapse
 
mehdiraash profile image
Mehdi Raash • Edited

I like a lot of React's fresh ideas about VDOM, and component-based, and even JSX, but I feel like I dislike pre-compiling, translating, transpiling and totally any "pre-*".
I know that the process of building have become a must nowadays, But all of those abstraction feel awkward.

Collapse
 
savagepixie profile image
SavagePixie

I also tend to dislike having to pre-compile things.

Collapse
 
nguyenhychan profile image
Nguyên H Trần (H. H. Y. Chan)

Personally I don't really like the way they deal with exceptions and errors. There were several moments when errors happen the screen just go blank without any easily accessible stack trace, error message or related information, unlike other frameworks which I use such as Laravel.

React.js is great by having the component concept which allows reusing the same construct for rendering similar structures, but when the data hierarchy becomes complicated, without a central storage of states it would be very difficult to manipulate nicely and write neat codes.

Collapse
 
savagepixie profile image
SavagePixie

Thanks for replying in such detail, that's very interesting.

Collapse
 
mwanahamuntu_ profile image
Stella Mwanahamuntu

I am newbie dev and i jump from one language to another as fast as the company i work for completes projects. I find the whole single page arrangement fascinating.

Collapse
 
cess11 profile image
PNS11

It is a quite nice fit for ClojureScript development.

reagent-project.github.io/