Create React App on Netlify

Create React App is a command line tool that generates a boilerplate React single-page application with a pre-configured build pipeline. It simplifies the complexity of setting up a React project, allowing you to focus on building out the app itself.

# Key features

These features provide important benefits for Create React App projects, including ones built and deployed with Netlify.

  • Simplified project setup. You can use create-react-app commands to set up a project with build tools like webpack without the need to configure default settings.
  • Modern JavaScript ecosystem support. Create React App supports a superset of the latest JavaScript standard, including ES6 syntax and certain ES2016 and later features, including async/await, Object rest/spread properties, and dynamic imports. You can also develop your app with TypeScript.

# Netlify integration

When you link a repository for a project, Netlify tries to detect the framework your site is using. If your site is built with Create React App, Netlify provides a suggested build command and publish directory: react-scripts build and build. If you’re using the Netlify CLI to run Netlify Dev for a local development environment, Netlify also suggests a dev command and port: react-scripts start and 3000. You can override suggested values or set them in a configuration file instead, but automatic framework detection may help simplify the process of setting up a project with Create React App on Netlify.

React-specific environment variables

Any environment variables prefixed with REACT_APP_ are processed and made available in the browser for client-side JavaScript access. Visit the Create React App docs about custom environment variables for more information.

# More resources