← Back to React, page 6

react-0115 · Easy fresher

How do you start a new React project today, and why is Create React App no longer the answer?

Create React App was deprecated by the React team in 2025 and is not maintained for new projects. The React docs recommend starting with a framework (Next.js, React Router in framework mode, or Expo for native) when you need routing, data loading and server rendering. For a client-only app or learning, use a build tool such as Vite (npm create vite@latest). Choose a framework for production sites with SEO needs, and Vite for dashboards, tools and prototypes.

Full answer

Create React App (CRA) bundled Webpack, Babel and a dev server behind one command. It stopped receiving updates, its tooling became slow and outdated, and it never solved routing, data fetching or server rendering. The React team announced its deprecation in early 2025 and updated the docs to point new projects at frameworks or build tools.

Options now:

  1. A framework. Next.js (App Router, Server Components), React Router in framework mode (formerly Remix) and similar choices bring routing, data loading, code splitting, server rendering and deployment support. Choose one when you need SEO, fast first loads, or full-stack features. Expo is the recommended starting point for React Native.
  2. A build tool such as Vite. npm create vite@latest my-app -- --template react creates a small project with a dev server that uses native ES modules and fast hot reloading, and a production build with Rollup or, in recent Vite versions, Rolldown. You add a router and data library yourself. It suits single-page apps, internal tools and learning.
  3. Other tools such as Parcel or Rsbuild exist for specific preferences.

Typical Vite project files: index.html at the root with a <div id="root">, src/main.jsx that creates the root and renders <App /> (inside StrictMode), vite.config.js for plugins (the React plugin), and package.json scripts: dev, build, preview.

How to decide: Will pages need to be indexed by search engines or load instantly? Pick a framework. Is it a logged-in application behind authentication? Vite with a client router is fine. Is the team experienced with a framework? Use it for consistency.

In an interview, say that React is a library, so the "starting point" is a decision about tooling and rendering strategy, and that you can justify the choice.

The example is the entry file that a Vite template creates, run against a root element.

jsx
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

function App() {
  return <h1>Hello from a new React app</h1>;
}

// src/main.jsx in a Vite project looks like this. index.html provides <div id="root"></div>.
createRoot(document.getElementById('root')).render(
  <StrictMode>
    <App />
  </StrictMode>
);

await new Promise((resolve) => setTimeout(resolve, 30));
console.log('root contains: ' + document.getElementById('root').innerHTML);

This is the entry file of a Vite React template, run against a root element on the box. The build tool, dev server and framework options were not run here. Output of the run: root contains: <h1>Hello from a new React app</h1>

Key points

  • Create React App is deprecated and unmaintained for new projects.
  • Use a framework (Next.js, React Router framework mode) for routing, data and server rendering. Use Expo for native.
  • Use Vite for client-side apps, tools and learning.
  • A Vite project has index.html, src/main.jsx, vite.config.js and dev, build and preview scripts.
  • Choose by SEO needs, first-load performance and team experience.

Common mistakes

  • Starting a new project with Create React App from an old tutorial.
  • Choosing a client-only setup for a content site that needs search indexing.
  • Choosing a framework for a small internal tool and adding unneeded complexity.
  • Forgetting that the server needs an index.html fallback for client-side routes.
  • Treating the tool choice as permanent without a migration plan.

Follow-ups

  • What does a framework give you that Vite does not?
  • How would you migrate an existing CRA app to Vite?
  • Where do environment variables go in a Vite project?

Tips

  • Say CRA is deprecated and name the two modern routes.
  • Tie the choice to SEO and rendering needs.
  • Know the files in a Vite project.