Create React App TypeScript Template

1.3.0 · maintenance · verified Tue Apr 21

This package is the official TypeScript template for Create React App (CRA), a widely adopted command-line interface for bootstrapping single-page React applications. It provides a pre-configured setup with TypeScript out of the box, including a comprehensive build pipeline, a development server with hot-reloading, a testing framework (Jest), and linting (ESLint). Currently, CRA itself (and by extension, this template) is effectively in maintenance mode, with the last significant feature update being `react-scripts@5.0.1` in April 2022, primarily for React 18 compatibility. While stable and well-suited for existing projects or simple new ones, many developers are now opting for alternative tools like Vite, Next.js, or Remix for new projects due to their faster build times and more modern approaches to development.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates the initial command to create a new TypeScript React application using the CRA TypeScript template, navigate into it, and start the development server. It also shows the typical structure of a generated `App.tsx`.

npx create-react-app my-ts-app --template typescript

cd my-ts-app

npm start

// To build your application for production:
// npm run build

// Example of a basic component structure in src/App.tsx after creation:
// import React from 'react';
// import './App.css';

// function App() {
//   return (
//     <div className="App">
//       <header className="App-header">
//         <p>Edit <code>src/App.tsx</code> and save to reload.</p>
//       </header>
//     </div>
//   );
// }

// export default App;

view raw JSON →