React JS Pros and Cons in 2020
Tags: react, webdev
Published: 2020-09-08 12:24:46

<h2><strong>What is React JS?</strong></h2>

<p>In short, React JS is a JavaScript library for building user interfaces. It was created and released by Facebook as an open-source framework in 2013. Since then, React has become one of the top loved and wanted frameworks. It happened because of the focus on user experience and development simplicity. But don't take our word for granted — you can check the results of the survey conducted every year by StackOverflow:</p>

<figure class="wp-block-image"><img src="https://lh6.googleusercontent.com/k-m4snZKi4-65dlMEoz5Fj7Pg90zgHI2uKKyevTRxK96WOSFjn8xa2Ziy5CEfs6AXhiXT93gncAfriu6E9wJT-_BH_oeogV9lPTs4vybZRgaxmcBxn29CpFaIqW8iktJvOMXWN__" alt="React JS is one of the most loved web frameworks according to the StackOverflow survey"/><figcaption><a href="https://insights.stackoverflow.com/survey/2020#most-loved-dreaded-and-wanted" rel="noreferrer noopener nofollow">Source</a></figcaption></figure>

<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/oUlO5rtx1MGTF249Fz-iemLPH0g9Za13NvwNnB06PdpyEnHuyke2kJK4a9EOqOxZ3A1r7Nz44lvi53K3WMVqsYNgPut-MIV2pOoQhh4aC0mKMBer_pJ8tNcYbhgByR-JcdQAuASm" alt="React JS is one of the most wanted web frameworks according to the StackOverflow survey"/><figcaption><a href="https://insights.stackoverflow.com/survey/2020#most-loved-dreaded-and-wanted" rel="noreferrer noopener nofollow">Source</a></figcaption></figure>

<p>There are three main features of React you should familiarise yourself with:</p>

<ul><li><strong>Declarative style</strong> — creating interactive user interfaces is as easy as pie. All you have to do is to design simple views for each state in your app, and React will take care of updating and rendering components whenever the data will change.</li><li><strong>Component-based architecture</strong>&nbsp;— it's a method for encapsulating single pieces of a more extensive UI (which are called components) into independent micro-systems. In other words, you can build components and then comprise them to create complex user interfaces.</li><li><strong>"Learn Once, Write Anywhere" rule</strong> — you can re-use existing code whenever you need, i.e. to build new features. React can also use Node.js to render on the server and React Native to boost mobile applications.</li></ul>

<h2><strong>What can you build using React JS?</strong></h2>

<p>The decision to incorporate React in your tech stack might become easier if you will find out what you can potentially build with it and if it something you are interested in. So without further ado, let's get to the list of possibilities:</p>

<h3><strong>Single Page Application (SPA)</strong></h3>

<p>It's the most often example of using React JS. As a reminder, Single Page Application is an application that doesn't require page reloading on the user's side. In other words, a visitor will keep interacting with the same page without the necessity of loading new pages. The great examples of Single Page Applications are Gmail and Facebook.</p>

<h3><strong>Cross-platform mobile applications (with </strong><a href="https://pagepro.co/react-native-development.html" target="_blank" rel="noreferrer noopener"><strong>React Native</strong></a><strong>)</strong> </h3>

<p>If you want to create a cross-platform native-like application, you can do it with React and the help of React Native. It's cross-platform because you need to build only one app instead of two native apps, and it's native-like because the apps built with React Native perform like native apps.</p>

<h3>Dashboard or Data Visualization tools</h3>

<p>If you somehow rely on data, it's crucial to display it in an understandable and visually attractive way to the end-user. Although you can find many ready-to-use dashboard templates, it's hard to maintain them in the long term, and the price you would have to pay is pretty high. Because of that, it's better to build it from scratch. And actually, React comes with some features to help you with that task: reusable components and the virtual DOM.</p>

<h3>eCommerce or retail websites</h3>

<p>In contrast to standard business websites, eCommerce and retail sites contain many more advanced elements like APIs, filters, internal search engine, etc. Thanks to React, developers can implement all of those things by building separate and easy-to-scale components.</p>

<h3>Enterprise Web Apps</h3>

<p>Component-based architecture is the reason why such enterprises as Walmart or AirBnB decided to incorporate React in their tech stacks. Such an approach allows for dividing the enterprise application development process into smaller parts using single UI components. </p>

<h3>Messaging app</h3>

<p>Since Facebook created and released React, it's a bit surprising that its development team don't use it for building Messenger. Still, it's possible to create an instant messaging app with the usage of React because it acts as a WebSocket client. It's responsible for two-way communication between the server and the client.</p>

<h3><strong>Personal or professional blogs (with </strong><a href="https://pagepro.co/gatsby-development.html" target="_blank" rel="noreferrer noopener"><strong>Gatsby</strong></a><strong>)</strong></h3>

<p>Although it's possible to create a website with the React.js itself, it's even better to use Gatsby for such a task. It's a modern front-end framework gaining popularity among front-end developers and JavaScript lovers. You can use it to create super-fast business and personal websites in no time that will pull data from many different sources like WordPress or Contentful.</p>

<h3>Social network</h3>

<p>This point is highly connected with the previous one because it's recommended to build social networks as Single Page Applications (SPAs). Since the SPA user doesn't have to reload the page, i.e. to check new messages, it strongly improves user experience.</p>

<h2><strong>What are the benefits of React JS?</strong></h2>

<p>Now, even if you don't have a specific project in mind, take a look at the list of React JS benefits below. Some of them are important from a business owner's perspective, and some from the technical point of view.</p>

<h3><strong>From a business owner's perspective</strong></h3>

<h4>Cost-effectiveness</h4>

<p>Since there is no need to start spending big bucks right from the beginning and thanks to shortened time to market (TTM), choosing React as your technology saves you money.</p>

<h4>Great user experience</h4>

<p>Nobody likes to wait in line and waiting until the website will load entirely feels just like it. It affects user experience in a bad way because it discourages users from interacting further with your website.</p>

<p>Luckily, React has features that make React applications not only fast but blazingly fast: Concurrent Mode, React Fiber, Suspense, virtual DOM, to name a few.</p>

<h4>Popularity</h4>

<p>React is not some one-season passing trend. The thing is actually contrary — it's a stable and mature technology. It will be there in subsequent years, only better.</p>

<h4>Performance and speed enhancement</h4>

<p>When it comes to technology like libraries or frameworks, its performance and speed is the key to success. Well, it's the reason for React's success and popularity. Just think about it — if React can handle Facebook, the most often used application out there, it can handle anything.</p>

<p>And the reason that React is so fast is the virtual DOM. Instead of generating all the HTML files every time, it looks for differences between the old DOM and current file and updates it accordingly.</p>

<h4>SEO-friendly</h4>

<p>Not only Facebook loves React, but Google does, too. While search engines have troubles with reading JavaScript-heavy applications, it's different for React applications. It's because they can run on the server while the virtual DOM takes care of rendering and returning to the browser.</p>

<h4>Shortened time to market</h4>

<p>Time is money, especially for startups and other companies with the objective to build digital products. Since React makes the whole development process faster, it's possible to test the MVP on the market much quicker and make changes accordingly without spending big bucks on it.</p>

<h3><strong>From a developer's perspective</strong></h3>

<h4>Backward compatibility</h4>

<p>The thing is some of the frameworks require code rewriting after upgrading the framework to the latest version. Well, not in the case of React.js. The public API remains almost the same every time, so it's easier for Facebook and other companies to refresh code while using its old pieces.</p>

<h4>Conccurent Mode</h4>

<p>Concurrent Mode is a set of features, created to make React applications even faster and user-friendlier. It makes them adapt to the user's device capabilities and network speed.</p>

<p>If you would like to find out more, <a href="https://pagepro.co/blog/what-is-react-concurrent-mode-and-why-you-will-love-it/">read our article</a>.</p>

<h4>Creating Dynamic Web Applications becomes easier</h4>

<p>Before ReactJS entered the stage, creating dynamic web applications because it required complex coding. ReactJS changed that by simplifying this process with the help of JavaScript Extension. Thanks to JSX, HTML quotes and tag syntax can render specific subcomponents. Also, JavaScript Extension makes creating machine-readable codes easier.</p>

<h4>Custom React Renderers</h4>

<p>Extending React.js by releasing React Native forced developers to start implementing different rendering. And that was an origin of Custom React Renderers concept. Thanks to it, you can build custom implementation.</p>

<h4>Development time</h4>

<p>React is all about speed, and it doesn't mean only page load speed but also development speed. Many things speed up the development process:</p>

<ul><li>ready-to-use solutions</li><li>created components are reusable</li><li>possibility to set up a web app by using "Create React App", which is a starter kit provided by Facebook</li></ul>

<h4>Easy to learn and use</h4>

<p>If you have JavaScript developers on board, it won't take them long to learn React. However, you would need someone experienced to navigate them through the learning process.</p>

<h4>It's easy to hand it over</h4>

<p>The component-based approach makes React applications readable, understandable and easier to maintain. If the code is clean, it's easy for an external developer to understand it, and take it over from there.</p>

<h4>It's easy to hire React developers</h4>

<p>The demand for React developers is growing, and so is the number of them. This is why finding someone with a good grasp of React to join your dev team should be easy.</p>

<h4>Easy to scale</h4>

<p>Thanks to the modularity, it's easy to scale React applications. You can start small and build up from there. For example, you can start with building simple MVP and then make it single-page application as comprehensive as Facebook. </p>

<h4>Helpful tools</h4>

<p>React developers have a set of handy tools at their disposal called React Developer Tools. It's an extension to Google Chrome and Mozilla Firefox that allows for checking the components hierarchy in the virtual DOM. It also makes it possible to edit particular components.</p>

<h4>Huge community</h4>

<p>Since its beginning in 2013, React community grew rapidly and heck, it's still growing. There is a great chance that a problem you are trying to solve is already solved or you will easily find someone that will help you out. It's because there are many contributors out there who want to make React better and better.</p>

<h4>Reusable components aka modularity</h4>

<p>The component-based approach is of much help here because React apps consist of single components, which can be divided into subcomponents. Every component and subcomponents are responsible for one small piece of the whole application and can be reused whenever and wherever you need. Thanks to that, it's possible to build a complex application out of simple blocks.</p>

<h4>Testing and debugging friendliness</h4>

<p>ReactJS uses native tools to test and debug components before actually using them. </p>

<h2>What are the disadvantages of React JS?</h2>

<p>Like any other technology, React also has its flaws. The good news is that the number of them decreases month by month, year by year, and those left behind are acceptable in many cases.</p>

<h3>Incompleteness</h3>

<p>React provides only the View part of the MVC model. Because of that, you will have to rely on other technologies, too. However, some developers perceive it as an advantage because it allows for full independence. Because of that, every project might look different.</p>

<h3>The high pace of development</h3>

<p>React is still a quite new technology and it evolves blazingly fast. Therefore, it may be hard for some to keep up this pace because of new features coming out and old ones being forgotten. And some just don't and won't like constant changes.</p>

<h3>Lack of proper documentation</h3>

<p>It's a very interesting point because opinions are divided. For some, React documentation is poor, and they are in the majority. However, some developers like it. In short, you should see for yourself.</p>

<h2>Summary</h2>

<p>In the right, technical hands, React is a powerful tool to build reliable, performant and scalable digital products. Business owners will especially appreciate its cost-effectiveness, shortened time to market and SEO-friendliness. On the other hand, developers will enjoy a component-based approach and shortened development time.</p>

<p>If React is not enough for you, check out what you can do with its extension — <a href="https://pagepro.co/blog/react-native-guide-2020-top-mobile-framework/" target="_blank" rel="noreferrer noopener">React Native</a>.</p>