Chapter 4. React’s Strengths
Up to this point, I have focused on React at a high level. We have talked about what it is, reviewed its main innovations, and drawn comparisons to some of the other major frameworks. In this chapter, I want to go deeper into the ways that React and tools like it can help teams, projects, and companies be more efficient.
Versatile Migration Path
React was built for incremental adoption from the beginning and can often be added to a small area on an existing page or app regardless of what technology is already in place. As a testament to its versatility, the Ember.js team briefly considered using React as a drop-in replacement for their view layer. React’s focus allows development teams to migrate as quickly or slowly as they would like. Often the best way to try to migrate to React is to rewrite a small piece of the UI to test its ability to solve problems in your domain. It is worth noting that React is a rendering engine that needs to be included in your bundle. As of version 16.4, React is about 32.5 KB gzipped, so piecemeal migration will negatively impact page weight until old libraries are removed. If this is too much overhead for your project, and you can afford to drop support for older browsers, alternatives such as Preact implement the same API and are about 7% of React’s size. If this describes your project, I should also say congratulations on running such a tight performance budget!
Runtime Performance by Default
Libraries and frameworks ...