ReactEasy

What is Create React App (CRA)?

Create React App was the official zero-config tool (npx create-react-app) for starting React single-page apps with webpack, Babel, Jest and a dev server preconfigured. The React team deprecated it for new apps in February 2025; it is in maintenance mode, and new projects should use a framework (Next.js, React Router, Expo) or a build tool such as Vite, Parcel or Rsbuild.

What CRA gave you

  • One command to a working app, with react-scripts hiding webpack and Babel config.
  • npm start, npm test, npm run build.
  • eject to expose and own the config, irreversibly.

Why it was deprecated

  • No active maintainers for a long time, and slow builds compared to modern tools.
  • Client-only SPA by default: no routing, data fetching, code splitting conventions or server rendering, leading to slow initial loads and request waterfalls.
  • React's recommended architecture moved to frameworks with Server Components and SSR.

Migrating an existing CRA app

  1. To Vite: install vite and @vitejs/plugin-react, move public/index.html to the root with a <script type="module" src="/src/main.tsx">, rename REACT_APP_ env vars to VITE_ and read them from import.meta.env, and replace Jest with Vitest (or keep Jest).
  2. To a framework: Next.js and React Router publish CRA migration guides.

Interview tip

Say it is deprecated and why, and name what you would use today.

Code example

tsx
1// Old: npx create-react-app my-app (deprecated for new apps since Feb 2025)
2
3// New SPA with Vite 8:
4// npm create vite@latest my-app -- --template react-ts
5// Or with the React Compiler enabled:
6// npm create vite@latest my-app -- --template react-compiler-ts
7// New full-stack app:
8// npx create-next-app@latest or npx create-react-router@latest
9
10// Migrating env vars from CRA to Vite
11// CRA: process.env.REACT_APP_API_URL
12// Vite: import.meta.env.VITE_API_URL
13
14// vite.config.ts
15import { defineConfig } from "vite";
16import react from "@vitejs/plugin-react";
17
18export default defineConfig({
19 plugins: [react()],
20 server: { port: 3000 }, // keep CRA's familiar port
21 build: { outDir: "build" }, // keep CRA's output folder for existing deploy scripts
22});

Practice this question

Open it in the study app to track progress, take notes, listen to the answer and work through the rest of the React set.

Open in study app