TNS
VOXPOP
Where are you using WebAssembly?
Wasm promises to let developers build once and run anywhere. Are you using it yet?
At work, for production apps
0%
At work, but not for production apps
0%
I don’t use WebAssembly but expect to when the technology matures
0%
I have no plans to use WebAssembly
0%
No plans and I get mad whenever I see the buzzword
0%
Frontend Development / JavaScript

The Pros and Cons of Using React Today

An in-depth look at the state of the React JavaScript framework — its strengths, its limitations, and how reliable it is for developers today.
Dec 4th, 2023 8:48am by
Featued image for: The Pros and Cons of Using React Today
Image via Pexels

Over the past decade, React has become renowned by developers across the industry for its powerful capabilities in helping them build cutting-edge user interfaces.

This article offers an in-depth and balanced perspective on React at the end of 2023 and heading into 2024. We’ll look at its commendable strengths, its notable limitations, and how reliable it is for developers today.

Let’s start with React’s innovative features that set it apart, before turning our attention to the challenges it presents to developers.

What Is React JS?

ReactJS, a component-based JavaScript library, was originally created by Facebook and released exactly ten years ago. The library simplifies the creation of interactive user interfaces for developers, while efficiently managing the state of components. Its ability to compose multiple components for complex applications without losing their state in the browser’s DOM (Document Object Model) is a significant advantage for many devs out there.

While primarily a tool for web applications, React’s versatility extends to mobile app development through React Native. This powerful open source library allows for the development of Android, iOS and Windows apps, demonstrating React’s flexibility in development across platforms.

The React Ecosystem

One of React’s greatest assets is its vast ecosystem, replete with third-party libraries and tools that greatly expand its capabilities. This is particularly advantageous for complex projects like route planning apps, which often rely on integrating a multitude of external services — such as mapping APIs and routing algorithms.

React’s flexibility and compatibility with a wide range of third-party services simplify the integration process, allowing developers to enhance their applications with advanced functionalities without excessive overhead.

At its core are essential libraries and tools like React Router for dynamic routing in single-page applications, ensuring seamless user experience transitions. Redux, a pivotal state management tool, creates a central store for state — enabling different components to consistently access and update it, which is particularly crucial in large-scale applications.

React.js: More than Just Complexity

While React excels in UI creation, it falls short in areas like state management and SEO optimization. Fortunately, the wider JS ecosystem provides a multitude of tools with benefits such as a more streamlined approach to state management, enhanced SEO with server-side rendering, and database management. Let’s take a look at some of React’s more prominent integration options.

For those seeking a simpler alternative, MobX offers an intuitive approach to state management with less boilerplate. Furthermore, Next.js addresses the current SEO limitations of client-side rendered apps by providing server-side rendering and static site generation. When it comes to development and testing, the Create React App streamlines the process of setting up a new front-end build pipeline, allowing developers to hit the ground running without being bogged down by configuration.

Meanwhile, Storybook serves as a UI development environment where developers can independently visualize the different states of their UI components. Jest, popular for unit and snapshot testing, integrates smoothly with React. Enzyme, developed by Airbnb, is a testing utility that simplifies the process of asserting, manipulating, and traversing the output from React Components.

Additional libraries and utilities further enrich the React ecosystem; Material-UI and Ant Design offer comprehensive UI frameworks that cater to aesthetic and functional requirements, while Axios provides a promise-based HTTP client for making HTTP requests. React Query simplifies the process of fetching, caching and updating asynchronous data, and React Helmet assists in managing changes to the document head, which is crucial for SEO in SPA.

React’s integration with other technologies — like backend frameworks, including Node.js and Django; and front-end state management libraries, like Apollo GraphQL’s React Client — enhances its flexibility. Nowadays, devs can even embed a PDF viewer into a site and drastically improve the user experience.

However, its continuous evolution demands that developers stay abreast of the latest changes and advancements, a challenge counterbalanced by the myriad of solutions that React provides for developers trying to craft high-quality, scalable and maintainable web applications.

Pros of React

React has established itself as a key library for building dynamic and responsive web applications for the following reasons:

Component-Based Architecture

Traditional JavaScript apps often struggle with state management as they scale. React, however, offers sophisticated, independently maintained and reusable components, allowing developers to update parts of a webpage without affecting others — to ensure loose coupling and collaborative functionality.

Of course, this concept isn’t exclusive to React; Angular, for instance, also uses components as fundamental building blocks. Nevertheless, React’s larger community, Meta’s backing and a less steep learning curve make it a favorite amongst devs.

Enhanced Customization in Development

React’s versatility shines when it comes to building bespoke applications tailored to specific business needs. In particular, its component-based architecture allows for the seamless assembly of complex structures in apps.

For instance, when constructing an integrated dashboard, React’s ecosystem facilitates the integration of various modules — such as charts, widgets and live data feeds — into a cohesive interface that empowers developers to craft user experiences that aren’t just functional, but also intuitive and visually engaging.

This kind of robust adaptability underscores exactly why React continues to be a top choice for developers who aim to create versatile and robust web applications.

Future-Proof Choice for Developers

The future-proof nature of React is one of the most compelling advantages that it offers developers. React’s flexible architecture caters to current web development needs, while also seamlessly adapting to emerging technologies that will shape the near-term of the industry.

Notably, machine learning is making significant inroads into web development, with the global ML market already being worth $21 billion in 2022, underscoring the importance of React’s future-proof nature and the ability to harmonize with such advancements.

One of the more prominent examples is TensorFlow.js, an ML library used for image and pattern recognition. Likewise, React allows for the integration of ML-powered chatbots and even recommendation features. In addition, WebAssembly can be a helpful aid in allowing ML apps coded in Rust, Python or C++ to exist within a native app.

Redux for State Management

In Single Page Applications, also known as SPAs, where multiple components reside on a single page, managing state and inter-component communication can quickly become challenging — which is exactly where Redux for React shines.

An integral part of React, it serves as a “manager” to ensure a consistent and accurate data flow among components that centralizes state management and fosters component independence, significantly improving data stability and user experience.

Cons of React

While React provides plenty of advantages to developers of varying skill levels, it’s not without its respective drawbacks, including the following:

  • Complex Concepts and Advanced Patterns: React introduces several advanced concepts and patterns that can be overwhelming for beginners at first. Understanding JSX, components, props, state management, lifecycle methods, and hooks requires a solid grasp of JavaScript fundamentals.
  • Integration Complexity with Other Technologies: React is often used in conjunction with other tools and technologies — like Redux, React Router, and various middleware — and understanding how to integrate these technologies with React can be challenging for newcomers.
  • Barrier for Non-JavaScript Developers: React’s heavy reliance on JavaScript can be a barrier for developers who are not proficient in JavaScript. While JavaScript is a versatile and widely used language, developers coming from different programming backgrounds may find it challenging to adapt to JavaScript’s paradigms and React’s way of using it.
  • Not a Full-Fledged Framework: React primarily handles the “View” part of the MVC, also known as the Model View Controller architecture. For “Model” and “Controller,” additional libraries are needed, which can ultimately lead to less structured and potentially more chaotic code compared to full-featured frameworks like Angular.
  • Code bloat: React.js, characterized by its substantial library and dependency requirements, is notorious for its bloated applications. This bloat often manifests in longer loading times, particularly in complex projects. The framework’s structure, relying heavily on its virtual DOM, necessitates loading entire libraries for even minor functionalities, significantly increasing the application’s digital footprint and reducing its efficiency.
  • Reduced performance on legacy devices and weak networks: The performance of React.js applications tends to degrade on older hardware and in areas with poor internet connectivity. This is primarily due to the framework’s client-side rendering model and intensive JavaScript processing. These factors can cause delays in rendering interactive elements, which is particularly noticeable on devices with limited computational capabilities or in environments with restricted bandwidth — and this adversely affects user experience.

The Final Verdict

As the web development space continues to evolve, React’s flexibility and robust ecosystem stand it in good stead. It will continue to enable developers to seamlessly incorporate cutting-edge features into their applications. However, while offering plenty of benefits for devs, React still has its drawbacks.

React’s complexity and reliance on advanced JavaScript concepts present a significant learning curve, particularly for newcomers or those not already well-versed in JavaScript. It also primarily addresses the “View” aspect of the MVC architecture, necessitating the need for additional tools for complete application development, which can lead to more intricate and less structured codebases.

Despite these challenges, the large and active React community plays a vital role in its ongoing development. It will continue to be a pivotal library in web and mobile app development for the foreseeable future.

Group Created with Sketch.
TNS owner Insight Partners is an investor in: Apollo GraphQL.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.