DEV Community

Why Should We Use React For the Front-End?

Arnab Saha on May 18, 2024

React JS is a JavaScript library built and maintained by Facebook. React is an efficient, declarative, and flexible open-source JavaScript library ...
Collapse
 
jonrandy profile image
Jon Randy 🎖️

React JS was designed to provide high performance in mind. The core of the framework offers a virtual DOM program and server-side rendering, which makes complex apps run extremely fast.

In benchmarks, React is consistently one of the slowest such UI libraries around

Collapse
 
forguz profile image
Nicolas Dellazzeri

React is fast in the sense that his code tends to be orthogonal, since it's split in components and the essence of these components came from pure functions, making it easier to give maintenance and to provide reusability of code. I find it easy to maintain react components while using the Atomic Design approach that works well alongside react.

In my experience working with React, Vue, Svelte, I've observed that React tends to be more decoupled than the other two technologies.

Collapse
 
moopet profile image
Ben Sinclair

There's nothing wrong with learning React, but some of your points feel a little misleading.

@jonrandy has already mentioned speed, but things like

Compared to other front-end frameworks, the React code is easier to maintain and is flexible due to its modular structure.

I don't think that's the case - or rather, it depends what you're comparing it to and how you're measuring it. Regardless, I think a lot of people would disagree with this point in 2024.

You have a whole section about how the ability to write custom components is related to having a high-quality UI, but writing "custom components" isn't unique to React. You can do it in vanilla Javascript!

If the user interface is poorly designed, then it lowers the chances of an application to succeed.

How the UI is designed is nothing to do with how it's implemented. Sure, your app could be a chore to use or a delight, but so long as the developer is competent, that's up to your UX and design teams, and involved a host of different processes from mapping out user journeys to focus groups to meta-analyses of activity information, etc. Your users aren't going to know or care whether you use React.

Collapse
 
ravavyr profile image
Ravavyr

The best choice for any project is the language and codebase you are most familiar with. Anything else requires a learning curve. Get good at one thing, any thing and you'll be able to build anything.

Articles like this are nonsense. Especially considering it shows zero data or code to back up any of its claims.

Collapse
 
sw33tblo55om profile image
Nicole • Edited

That is why I keep going in Python, also for the frontend.

Found this very interesting open source project that allows me to fully utilize my applications in pure Python:

rio.dev/
github.com/rio-labs/rio

Collapse
 
nigel447 profile image
nigel447

have you seen jinja ?

Collapse
 
miketalbot profile image
Mike Talbot ⭐

When people say React should die for the Internet to improve, it's for the reason why many companies choose it, and probably the best reason to use it: more people are experienced in React than they are in other frameworks, so it is easy to find staff to work on projects.

To some extent, React's popularity is why we use it for our core project, for us the downsides of size etc are close to irrelevant and its style of producing components fits better with my architectural choices for our micro front-end system and loosely coupled front-end. The last time I did an assessment was in 2020 though. Then it was: my first choice Svelte (but none of the rest of the team were interested in learning it back then), then React, with Angular and Vue not being well suited to the inversion of control architecture I was designing. To be clear, I'm sure they are great at other things.

Fundamentally there is no magic bullet, no perfect framework. You choose something capable of the design you want and you build with it, and live with the consequences. The wars raged over frameworks, the endless "this should die" or "this is the only way" articles are a boring waste of time.

Collapse
 
wearypossum4770 profile image
Stephen Smith

This is a poorly written article. It is subjective and provides no examples. Do better.

Collapse
 
dsaga profile image
Dusan Petkovic

I feel its just an AI article, smells like one.

Collapse
 
dsaga profile image
Dusan Petkovic

I feel like this statement doesn't make sense "Too much boilerplate code to write
" I don't think there's more boilerplate than any other front-end framework/library, you're basically left to architecture your own framework or follow a common pattern.

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

The main problem here is the apparent inability of people to move on. "It is very easy to find trained people in React", or "You can find a library for anything in React". These statements are the problem and why 90% of the coders out there will be replaced by AI bots in 2 decades (yes, AI is still nowhere near producing decent code).

The fact is that React is one of the worst choices out there and people just need to snap out of its incantation. I am a Svelte supporter because I have never ever seen a framework that is so easy to understand, yet so powerful. I have said it before: People say devs won't move on because of the learning curve. Then let's get it done with. Svelte's learning curve is particularly flat and easy if you know at least one other framework.

Whatever framework you choose, as long as it is not React or Angular, you'll probably be in a better position.

Collapse
 
miketalbot profile image
Mike Talbot ⭐

This is impractical as a choice for me. I've got projects to complete and React as a tool is just fine. I don't have the budget to train a team of 30 in a new platform and then discover all of the new ways we can make bugs, find the challenges in all of the libraries that mimic what I already have. That would deliver me 0 value. React causes me very few issues. I'm not sure why this should bother anyone else.

My investors would think I was mad to throw away money on replatforming without demonstrable value.

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

React is an efficient library

Such a lie. Interactive Results

The truth is that React is one of the worst performers ever.