What is create-react-app?
create-react-app is a command-line tool that allows you to create a new React application with a single command. It sets up a modern web development environment with no configuration needed, providing a solid foundation for building React applications.
What are create-react-app's main functionalities?
Project Initialization
This command initializes a new React project in a directory called 'my-app'. It sets up the project structure, installs dependencies, and configures the build tools.
npx create-react-app my-app
Development Server
This command starts a development server that serves your React application. It supports hot reloading, so changes to your code are reflected in the browser without needing a full page refresh.
npm start
Build for Production
This command creates an optimized production build of your React application. It bundles the code, minifies it, and prepares it for deployment.
npm run build
Running Tests
This command runs the test suite for your React application using Jest. It watches for changes and re-runs tests automatically.
npm test
Ejecting
This command ejects the configuration files from create-react-app, allowing you to customize the build setup. This is a one-way operation and is not recommended unless you need to make advanced customizations.
npm run eject
Other packages similar to create-react-app
vite
Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects. It offers a similar zero-config setup for React applications but is known for its faster build times and hot module replacement.
next
Next.js is a React framework that provides a hybrid static & server rendering, TypeScript support, smart bundling, route pre-fetching, and more. It is more feature-rich compared to create-react-app and is suitable for building both static websites and server-rendered applications.
parcel
Parcel is a web application bundler that offers a zero-configuration setup similar to create-react-app. It is known for its fast performance and simplicity, making it a good alternative for small to medium-sized projects.
5.0.1 (2022-04-12)
Create React App 5.0.1 is a maintenance release that improves compatibility with React 18. We've also updated our templates to use createRoot
and relaxed our check for older versions of Create React App.
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@5.0.1
or
yarn add --exact react-scripts@5.0.1
:bug: Bug Fix
react-scripts
create-react-app
- #11915 Warn when not using the latest version of create-react-app but do not exit (@iansu)
react-dev-utils
:nail_care: Enhancement
cra-template-typescript
, cra-template
, react-scripts
cra-template-typescript
, cra-template
eslint-config-react-app
:memo: Documentation
:house: Internal
Committers: 11