Chapter 3Create a Production Build

Many applications that rely on sophisticated JavaScript components fail to live up to their potential because they load slowly. Here, you’ll learn how to spare your own creations from this fate.

Let’s look at the word counter we’ve built in the previous two chapters. We need four network requests: one to download React, one to download ReactDOM, one to download Babel, and one for the word counter itself. Loading speed is critical for user satisfaction,[8] but people can’t start using the app until the last file downloads.

As an application grows, it’s tempting to split the code across multiple files so we can navigate the project more easily as we modify things. For example, we might place the SaveManager ...

Get React for Real now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.