DEV Community

Ayako yk
Ayako yk

Posted on

Advantages and Disadvantages of React

I recently had a job interview where I was asked questions about React and JWT. I managed to answer them and got the job. However, I couldn't shake the feeling that my initial reasons for using React, such as ita popularity and being taught by my school instructor, were somewhat lacking. Now that I've gained more experience with various programming languages and have a broader perspective, I feel it's time for me to confidently articulate the advantages and disadvantages of React.

I still can't definitively say whether React is good or bad, so I'll list some pros and cons that are commonly discussed among developers.

Pros:

  • Virtual DOM
  • Reusable Components
  • Scalability
  • One-Way Data Flow
  • React Native (for mobile app development)
  • SEO-Friendly
  • Strong Community Support
  • Easy to Learn
  • (Popularity)

Cons:

  • Development pace
  • Lack of documentation
  • Not MVC
  • JSX

Pros:
Virtual DOM
React uses a virtual copy of the DOM, allowing for fast updates. In a Single Page Application (SPA) like React, changes made on the page can pause the loading of a page. React's Virtual DOM concept acts like a copy of your real DOM, maintaining cached memory and avoiding the need for re-rendering the DOM trees repeatedly. This results in better app performance.

Reusable Components
React is made up of multiple components, each with its logic and control. There's no need to create components from scratch every time, making it easy to maintain and speeding up the entire development process.

Scalability
React’s modular design makes it easier to scale compared to many other platforms. Each UI can be broken down into smaller pieces, allowing you to simply add components or replace old ones with more robust versions.

One-way Data Flow
React's one-way data flow, or unidirectional data flow, ensures a clean data flow architecture. Data from a parent, called props, can only be passed down to its child components, not vice versa.

React Native
React has been upgraded to develop native mobile applications for both iOS and Android. Instagram, Facebook, and Netflix mobile apps are developed using React Native.

SEO-friendly
React is suitable for creating SEO-friendly web apps due to server-side rendering, dynamic rendering, and meta tags. For example, React can reduce loading time and enhance rendering speed.

Community
React is an open-source framework with a large community of developers, making it easy to find help and support.

Easy to Learn
(This seems dependable, but) React is said to be easy to learn because it requires basic knowledge of HTML and CSS.

Popularity
This is just my opinion, but discussing its popularity is important in addition to its advantages. In 2022, JavaScript was the most widely used programming language with over 60% market share. The most popular JavaScript frameworks were Node.js in the first place and React in the second, even more popular than Angular. Because of its popularity, the community is large, and more tutorials are available.

Cons:
Development pace
React has continuously developed, requiring developers to relearn. Some find this uncomfortable.
Lack of documentation
Due to continuous development, obtaining proper documentation can be challenging.

Not MVC
React covers only UI or View, requiring other tools for Controller and Model, such as API and routing.

JSX
This syntax extension can be a barrier for new developers to learn React due to its complexity.

These are the advantages and disadvantages often discussed among developers. For now, as a junior developer, I should keep those in mind and be on the same page with other developers to understand the React way. Eventually, I will be able to form my opinion based on the points discussed above.

What's your opinion?

Top comments (0)