Pros of React JS
#1 Component reuse
Why would you constantly reinvent the wheel, and spend a lot of time and money doing so, when you can simply reuse code that has already been written and tested by other developers? React JS uses the so-called components, which make it possible to split the UI into independent, reusable pieces, and think about each piece in isolation.
The official website of React JS lists many free components, including Chartify, a lightweight and customizable chart component, Halogen, a collection of highly customizable loading spinner animations, and Material-UI, a collection of components that implement Google’s Material Design.
#2 Virtual DOM
The Document Object Model (DOM), an application programming interface that represents an XML document as a tree structure wherein each node is an object representing a part of the document, is inefficient and slow because it’s necessary to recalculate the CSS, recreate the layout, and essentially repaint the entire web page every time the DOM changes.
React JS overcomes the DOM’s inefficiencies by using the so-called Virtual DOM. Just like the actual DOM, the Virtual DOM represents all elements and their attributes as a node tree. When something changes, React JS updates the Virtual DOM and figures out how it differs from the actual DOM, updating the actual DOM only with what has actually changed.
#3 Thriving community
Largely because React JS is an open-source library, there’s a massive, thriving community of users and developers around it. On GitHub, the project has over 130,000 stars, and it has been forked more than 20,000 times. Independent developers from around the world constantly propose new features and fix bugs large and small.
Since React JS is still very much a Facebook project, it enjoys the support and resources of one of the most successful tech companies in the world, so there’s absolutely no reason to worry about it dying any time soon. In fact, the popularity of React JS has been steadily increasing over the years, which is great news for everyone using it.
Cons of React JS
#1 High pace of development
Indeed, React JS is in a constant state of flux, with new features being introduced on a regular basis and old features becoming deprecated. Some developers are naturally not comfortable with such a high pace of development, preferring to use more mature web development technologies instead.
#2 Lack of conventions
Because React JS is a relatively young library that’s very actively developed by Facebook and contributors from around the world, there are very few established conventions to speak of, and those that exist come from Facebook, such as its component structure or state, props and context distinctions.
Over time, the situation will inevitably change, but not all developers are willing to wait until the dust settles and React JS code produced by 10 different React JS developers looks virtually indistinguishable. For the time being, the React JS documentation is arguably the most authoritative source of React JS best practices and conventions there is.
#3 Steep learning curve
For a relatively young library, React JS is pretty large, and its documentation is far from stellar. In fact, it leaves a lot to be desired, especially when it comes to new libraries like Redux and Reflux. Yes, you can find a ton of React JS resources on the internet, but there’s nothing like having access to comprehensive official documentation.
Summary of pros and cons of React JS
Of course, business owners don’t need to concern themselves with the cons of React JS too much because they can simply get in touch with a software development company that specializes in it and let it take care of everything.