Image

Use create-react-app to Start a Decoupled React Application for Drupal 8, 9, 10, and 11

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

⚠️Note: See Use Vite to Start a Decoupled React Application for a modern approach to scaffolding a decoupled React application.

Using create-react-app we can scaffold a stand-alone React application with boilerplate configuration and organization already in place. It's a great way to get started using React, as well as the ecosystem of associated tools like Webpack, Jest, and Babel. After creating the scaffolding, we'll port the code we wrote in previous tutorials to the new structure.

In this tutorial we'll:

  • Use create-react-app to scaffold a new React project
  • Refactor existing code into the organizational structure used by create-react-app
  • Confirm that our code runs

By the end of this tutorial, you should know what create-react-app is and how to get started using it.

Decoupled Headless Drupal