Create React App is deprecated: How to create a React app now

Contents
Create React App is deprecated, so a new React project should start with a framework or with Vite, depending on how much the app needs from a server. Frameworks such as Next.js and React Router framework mode bring routing, data loading and server rendering.
Vite suits a plain client-side app where the team owns those decisions. Existing CRA apps keep running, but they receive no new features. The right choice depends on rendering needs, team capacity and how much test and build configuration the current app carries.
Is Create React App deprecated? What to use instead
A React app created with Create React App today starts on a tool the React team deprecated on 14 February 2025. Existing apps keep working but get no new features, so new projects should start with Next.js, React Router, or Vite.
The choice depends on who owns routing, data loading and server rendering: a framework supplies conventions plus a server runtime to deploy, and Vite leaves those decisions to you.
Netguru designs and builds React web applications, and we recommend Vite for client-only apps and a framework when you need server rendering, because that matches how much architecture you want to own.
The Sunsetting Create React App post gives the React team's reasoning, and our React development services cover starting or migrating a production app.
Why did the React team deprecate Create React App?
The React team deprecated Create React App on 14 February 2025 because the tool had no active maintainers, and a bare build setup leaves routing, data fetching, and code splitting to each app while frameworks already solve those problems.
In Sunsetting Create React App, the team writes: "Today, we’re deprecating Create React App for new apps, and encouraging existing apps to migrate to a framework, or to migrate to a build tool like Vite, Parcel, or RSBuild."
That sentence is a recommendation, not a shutdown. The same post adds a deprecation notice to the Create React App website and GitHub repo, and says Create React App will continue working in maintenance mode, with a release that supports React 19. For an existing app, the decision comes down to whether anything is blocking you:
- Stay if the app builds, its dependencies pass your audit, and the roadmap needs neither server rendering nor new routing capabilities.
- Move if a dependency needs a newer toolchain than react-scripts supports, an audit flags transitive dependencies with no upgrade path, or the product needs server rendering or route-level code splitting.
Staying is not free, since react-scripts pins its own bundler and test runner versions and you cannot upgrade them piece by piece without ejecting. We'd suggest re-checking this decision at your next major React upgrade.
What replaces Create React App? Framework or build tool
Create React App has no single successor: new projects start with a framework such as Next.js or React Router framework mode, or with a build tool such as Vite for a plain client-side app. The react.dev "Creating a React App" page lists the same options.
If you are still weighing up what React is used for before choosing a starting point, our guide to what React is used for covers its core concepts and typical applications.
The options side by side:
| Option | What you get | Use it when |
|---|---|---|
| Next.js | File-based routing, server rendering, and data fetching in one package | The app has public, indexable pages and you can deploy a server runtime |
| React Router framework mode | Routing, route-level data loading, and mutations, with server rendering you can switch on or off | You want a router-centered framework, or an existing React Router app is growing server needs |
| Vite | A dev server, a production build, and a React template; no router or data layer | The app is a client-side SPA, such as an internal dashboard behind a login |
For native mobile apps, Expo is the React team's recommended starting point.
Choose Vite only when you accept owning routing, data loading, and any server rendering yourself. Choose a framework when you need those built in and can run a server runtime in production. Each Vite gap you fill with a library (a router, a data-fetching layer) becomes a dependency your team maintains.
We recommend a framework for any product app where search visibility or first-load time matters. Vite fits when the app sits behind authentication and a static host is enough. This is our judgment, not a rule from the docs.
One caveat: frameworks can also run without a server. Next.js can export static files and React Router framework mode can run without server rendering, so check each framework's docs against your hosting before ruling one out. Deciding between Next.js and a plain React setup is covered in Next.js vs React.
How to create a React app with Vite
To create a React app with Vite, run npm create vite@latest with the react-ts template, install dependencies, and start the dev server. Check Node.js first: the Vite Getting Started guide lists Node.js 20.19+ or 22.12+ as the version requirement, and some templates ask for newer. Compare that page with the output of node -v before you scaffold.
- Scaffold the project and start the dev server:
npm create vite@latest my-app -- --template react-ts
cd my-app
npm install
npm run dev
- Build for production with npm run build, which writes static files to dist. Run npm run preview to serve that output locally before you deploy it.
The double dash matters on npm 7 and later. Everything before it goes to npm create, which runs the create-vite initializer. Flags after it are passed through, so --template reaches Vite. Without the separator, npm consumes the flag and Vite falls back to its interactive prompts. The yarn and pnpm examples in Vite's guide omit the extra dashes.
To create the React app in the current directory, pass . as the project name: npm create vite@latest . -- --template react-ts. Vite asks what to do if the folder is not empty.
The template name decides the language and compiler. react gives you JavaScript, and react-ts is the TypeScript template with a tsconfig and .tsx files. The react-swc and react-swc-ts variants swap the React plugin's compiler for SWC.
We recommend react-ts for anything that will outlive a prototype, because adding TypeScript to a scaffolded JavaScript project later means writing the config and renaming files yourself.
The layout differs from Create React App in one place that matters. index.html sits at the project root, not in public/, and it is the entry point: it loads src/main.tsx, which mounts App.tsx. Our React project structure guide covers how to grow that layout.
The dev server serves your source files as native ES modules instead of bundling the whole app up front. Edits then reach the browser through HMR.
What does the Vite project structure look like?
A Vite React project keeps index.html at the project root as the entry point, and every script, stylesheet, and component you write lives under src. In a react-ts scaffold the layout is as follows (exact files vary by template version):
- index.html: the entry point. Vite treats it as part of the module graph, and a module script tag in it points at
/src/main.tsx. Create React App kept this file in public and injected the bundle for you. src/main.tsx: the entry file. It mounts the root component into the root element declared in index.html.src/App.tsx: the starter root component. Open it first and replace the demo markup.src/App.cssandsrc/index.css: starter stylesheets imported by the entry file and the root component.src/assets/: files you import from code, which the production build hashes and bundles.public/: files served as-is from the site root, such as the favicon. Nothing here is processed.- vite.config.ts: Vite configuration, with the React plugin registered.
- tsconfig.json: TypeScript settings. Recent templates split them into tsconfig.app.json for app code and tsconfig.node.json for config files.
- package.json: dependencies plus the dev, build, and preview scripts.
How to run a React app locally and build it for production
Run a React app locally with npm run dev, build it for production with npm run build, and check the result with npm run preview. In VS Code, open the project folder, press Ctrl+` to open the integrated terminal, and run each command from the project root.
- npm run dev starts the Vite dev server and prints a localhost URL, port 5173 by default. Edits reach the browser through hot module replacement, so component state usually survives a save.
- npm run build writes the production build output to dist: bundled, minified JavaScript with hashed asset filenames. In the react-ts scaffold the script typically runs the TypeScript compiler first, though the exact script varies by template version.
- npm run preview serves dist locally, on port 4173 by default, per the Vite static deploy guide.
npm run dev
npm run build
npm run preview
The dev server and the build do not run the same code path. The dev server serves your source as individual ES modules on demand, while the build bundles and minifies everything into dist. A page that works on the dev server can still break in the build.
Three differences are worth checking in the preview before every deploy:
- Environment variables: Vite loads different .env files by mode, and only variables with the VITE_ prefix are exposed to client code. A value set only for development will be missing in production.
- Asset paths: an app deployed under a subpath needs the base option set, or hashed assets return 404.
- Minified output: errors that depend on bundling or tree-shaking appear only here.
vite preview is a local check of the build output, not a production server. It will not reproduce your host's CDN, headers, or fallback routing for client-side routes.
How to start a React app with Next.js or React Router
Start a React app with Next.js when you want file-based routing and server rendering from the first commit. Choose React Router framework mode when your team already thinks in React Router routes and loaders. Both are React frameworks the React team lists for new projects.
The official create commands:
npx create-next-app@latest
npx create-react-router@latest my-react-router-app
Create-next-app prompts for options such as TypeScript and linting. The React Router command takes the target directory as an argument.
The trade-offs side by side:
| Next.js | React Router framework mode | |
|---|---|---|
| Routing | Folders under app/ define routes |
Routes declared in app/routes.ts, each pointing to a route module with a loader and action |
| Rendering | Server rendering or static generation, chosen per route | Server rendering on by default; ssr: false in react-router.config.ts gives a client-only build |
| Deployment | A Node.js server or a platform that runs one; static export with output: 'export' and fewer features | Node server via its serve package or an adapter; static assets when SSR is off |
The deployment row is the one that surprises teams coming from Create React App. A server-rendered app is a running process that needs a Node.js version, secrets, and monitoring, where a Vite build is a folder of static files on a CDN.
We recommend Next.js for content-heavy or SEO-sensitive products that need mixed rendering strategies. We recommend React Router framework mode for teams migrating a client-side app already built on React Router, because the routing concepts carry over.
For a logged-in dashboard with no indexing requirement, the static Vite build avoids the server entirely. The wider framework debate is in Next.js vs React.
How to migrate a Create React App project to Vite or a framework
Migrating an existing project to Vite means replacing react-scripts, moving the index.html entry point to the project root, and renaming environment variables. Most of the breakage comes from conventions that react-scripts applied silently.
The migration map, with the symptom you get if you miss each item:
| Area | Create React App | Vite | Symptom if missed |
|---|---|---|---|
| Entry | public/index.html with %PUBLIC_URL%, entry file injected by react-scripts |
index.html at the project root with an explicit module script pointing at src/main.jsx or main.tsx |
Dev server 404 or a blank page |
| JSX files | JSX allowed in .js | JSX needs .jsx or .tsx | Parse error on the first component |
| Environment variable prefix | REACT_APP_, read via process.env | VITE_, read via import.meta.env | Values come back undefined |
| Scripts | react-scripts start, build, test | vite, vite build, vitest | Output lands in dist, not build, so deploys fail |
| Test globals | Jest globals on by default | Vitest globals are opt-in | describe is not defined |
| SVG imports | import { ReactComponent as Logo } |
Plugin required | Import is a URL string or undefined, not a component |
The prefix change is the one that reaches production unnoticed. Rename the keys in .env and every read in the code, and delete leftover %PUBLIC_URL% placeholders in index.html. Vite exposes only variables with its prefix to client code, per its env variables and modes docs.
An envPrefix option can keep the old prefix as a stopgap, but the docs warn against exposing more than you intend.
Update the scripts block and remove react-scripts from package.json:
"scripts": {
"dev": "vite",
"build": "vite build",
"test": "vitest"
}
For tests, Vitest runs the same describe, it and expect calls, but you must either import them from vitest or enable globals in the config:
test: { globals: true, environment: 'jsdom' }
Replace jest.fn with vi.fn and move your setupTests file into the setupFiles option. SVG-as-component imports need vite-plugin-svgr, so check its README for the current import syntax.
We recommend moving to Vite first, since it is the smallest diff from a client-side CRA app. Move to Next.js or React Router framework mode only when you need server rendering or route-level data loading.
That second move is a rewrite of routing, and index.html disappears in favor of a root layout. Next.js also changes the client-exposed prefix to NEXT_PUBLIC_. Do the two migrations separately so a failing build points to one cause.
What did Create React App bundle that you now configure yourself?
Create React App bundled Jest, ESLint, a dev proxy, absolute imports and its webpack build behind one dependency, react-scripts. After you remove it, each of those becomes a file you own.
The old behavior and its replacement, side by side:
| Create React App behavior | Replacement on Vite |
|---|---|
| Jest preconfigured with jsdom and Babel transforms | Vitest, with test.environment set to jsdom in the Vite config |
| ESLint with eslint-config-react-app, run by the dev server and build | Your own ESLint config (the Vite React templates ship one), run as a separate npm script |
| proxy field in package.json | server.proxy in vite.config |
| Absolute imports through baseUrl in jsconfig or tsconfig | resolve.alias in vite.config, mirrored in tsconfig paths for the editor |
Vitest reads the same Vite config as the app, so aliases and plugins apply to tests without a second setup. Its API follows Jest closely, which means most test files port by replacing jest.fn and jest.mock with vi.fn and vi.mock. The Vitest docs list the remaining differences.
We recommend porting tests last. Get the app building and running first, because alias and proxy mistakes surface faster in the browser than in a failing test run.
Linting changes most visibly. With Create React App, lint errors appeared in the dev server overlay and could fail a build. On Vite they appear only when you run the lint script or your editor flags them, so add that script to CI.
Should you migrate an existing CRA app now?
Migrate an existing Create React App project when react-scripts blocks an upgrade you need. A stable app with few dependencies can stay where it is, because CRA apps keep working after the deprecation but get no new features.
We recommend deciding by blocker, size, test setup, and team capacity:
| Your situation | Decision |
|---|---|
| Stable app, few dependencies, no upgrade pressure | Stay, and review again when a dependency update fails |
| A React, TypeScript, or Node.js upgrade conflicts with react-scripts | Migrate to Vite |
| You need server rendering or route-level data loading | Move to Next.js or React Router in framework mode |
| Large Jest suite with heavy module mocking | Migrate in stages and budget time to port tests to Vitest |
| Small team with no spare capacity | Stay until a blocker appears |
The test suite usually costs more than the build config. Moving index.html to the project root, renaming environment variables, and swapping scripts are mechanical changes, while mocks written against Jest internals each need a manual port.
Vite keeps the client-side SPA shape, so it is the smaller move. A framework migration also changes routing and data fetching, which makes it a redesign of the app and a bigger commitment.
What to add after setup: Routing, data, styling and deployment
After setup, add React Router for routing, TanStack Query for server data, Tailwind CSS for styling, and a static host configured with a fallback to index.html.
The table gives our default for each concern in a plain Vite SPA:
| Concern | Our default | Why |
|---|---|---|
| Routing | React Router | Handles client-side routes in an SPA. Moving to framework mode later adds loaders and server rendering. |
| Data fetching | TanStack Query | Caches responses, deduplicates requests, and refetches in the background, so you skip hand-written loading and error state in useEffect. |
| Styling | Tailwind CSS | Utility-first classes scale across teams because nobody has to invent or coordinate stylesheet names. |
| Deployment | Static host with a CDN | Hosting platforms typically provide automatic HTTPS, CDN distribution, and a preview deployment for every commit. |
The deployment row has one common failure mode: client-side routes return 404 on refresh.
A Vite build produces static files in dist, and a request for /orders/42 matches no file on a static host, so the host answers 404 even though the route works inside the app.
The dev server falls back to index.html on its own, so the bug usually first appears after the first deploy. The early sign is a deep link that fails on reload while in-app navigation works.
The fix is a rewrite that serves index.html for any path that is not a file, with a 200 status. On Netlify, put this line in a _redirects file inside public/:
/* /index.html 200
On nginx, the equivalent is a try_files fallback in the location block:
try_files $uri /index.html;
Vercel and cloud storage buckets with a CDN offer the same rewrite in their own config formats.
This fallback suits apps behind a login. If public pages need server-rendered HTML for search, a rewrite will not give you that, and React Router in framework mode or Next.js is the better starting point.
FAQ
How do you create a new React app?
What replaces the create-react-app?
Can ChatGPT create a React app?
Start your next React project with a clear setup decision
Start a new project with Vite for a client-side app, or with Next.js or React Router in framework mode when the app needs server rendering. Create React App is deprecated, so it only comes up in migration plans.
Existing Create React App projects keep running, so a migration can wait for a planned slot. Inventory your environment variables, tests, and entry file first. We recommend choosing the target before touching code, because that choice sets your routing, data fetching, and deployment model.
Netguru designs, builds and scales React products, and our web development team handles both new builds and migrations. If you want a second opinion on your setup, talk to our team about your project.
