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-scriptshiding webpack and Babel config. npm start,npm test,npm run build.ejectto 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
- To Vite: install
viteand@vitejs/plugin-react, movepublic/index.htmlto the root with a<script type="module" src="/src/main.tsx">, renameREACT_APP_env vars toVITE_and read them fromimport.meta.env, and replace Jest with Vitest (or keep Jest). - 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)23// New SPA with Vite 8:4// npm create vite@latest my-app -- --template react-ts5// Or with the React Compiler enabled:6// npm create vite@latest my-app -- --template react-compiler-ts7// New full-stack app:8// npx create-next-app@latest or npx create-react-router@latest910// Migrating env vars from CRA to Vite11// CRA: process.env.REACT_APP_API_URL12// Vite: import.meta.env.VITE_API_URL1314// vite.config.ts15import { defineConfig } from "vite";16import react from "@vitejs/plugin-react";1718export default defineConfig({19 plugins: [react()],20 server: { port: 3000 }, // keep CRA's familiar port21 build: { outDir: "build" }, // keep CRA's output folder for existing deploy scripts22});
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.