• Stars
    star
    100,679
  • Rank 46 (Top 0.01 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Set up a modern web app by running one command.

Create React App Build & Test PRs Welcome

Logo

Create React apps with no build configuration.

  • Creating an App โ€“ How to create a new app.
  • User Guide โ€“ How to develop apps bootstrapped with Create React App.

Create React App works on macOS, Windows, and Linux.
If something doesnโ€™t work, please file an issue.
If you have questions or need help, please ask in GitHub Discussions.

Quick Overview

npx create-react-app my-app
cd my-app
npm start

If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

Then open http://localhost:3000/ to see your app.
When youโ€™re ready to deploy to production, create a minified bundle with npm run build.

npm start

Get Started Immediately

You donโ€™t need to install or configure tools like webpack or Babel.
They are preconfigured and hidden so that you can focus on the code.

Create a project, and youโ€™re good to go.

Creating an App

Youโ€™ll need to have Node 14.0.0 or later version on your local development machine (but itโ€™s not required on the server). We recommend using the latest LTS version. You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.

To create a new app, you may choose one of the following methods:

npx

npx create-react-app my-app

(npx is a package runner tool that comes with npm 5.2+ and higher, see instructions for older npm versions)

npm

npm init react-app my-app

npm init <initializer> is available in npm 6+

Yarn

yarn create react-app my-app

yarn create <starter-kit-package> is available in Yarn 0.25+

It will create a directory called my-app inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-app
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ node_modules
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ public
โ”‚   โ”œโ”€โ”€ favicon.ico
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ””โ”€โ”€ manifest.json
โ””โ”€โ”€ src
    โ”œโ”€โ”€ App.css
    โ”œโ”€โ”€ App.js
    โ”œโ”€โ”€ App.test.js
    โ”œโ”€โ”€ index.css
    โ”œโ”€โ”€ index.js
    โ”œโ”€โ”€ logo.svg
    โ””โ”€โ”€ serviceWorker.js
    โ””โ”€โ”€ setupTests.js

No configuration or complicated folder structures, only the files you need to build your app.
Once the installation is done, you can open your project folder:

cd my-app

Inside the newly created project, you can run some built-in commands:

npm start or yarn start

Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will automatically reload if you make changes to the code.
You will see the build errors and lint warnings in the console.

Build errors

npm test or yarn test

Runs the test watcher in an interactive mode.
By default, runs tests related to files changed since the last commit.

Read more about testing.

npm run build or yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Your app is ready to be deployed.

User Guide

You can find detailed instructions on using Create React App and many tips in its documentation.

How to Update to New Versions?

Please refer to the User Guide for this and other information.

Philosophy

  • One Dependency: There is only one build dependency. It uses webpack, Babel, ESLint, and other amazing projects, but provides a cohesive curated experience on top of them.

  • No Configuration Required: You don't need to configure anything. A reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.

  • No Lock-In: You can โ€œejectโ€ to a custom setup at any time. Run a single command, and all the configuration and build dependencies will be moved directly into your project, so you can pick up right where you left off.

Whatโ€™s Included?

Your environment will have everything you need to build a modern single-page React app:

  • React, JSX, ES6, TypeScript and Flow syntax support.
  • Language extras beyond ES6 like the object spread operator.
  • Autoprefixed CSS, so you donโ€™t need -webkit- or other prefixes.
  • A fast interactive unit test runner with built-in support for coverage reporting.
  • A live development server that warns about common mistakes.
  • A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
  • An offline-first service worker and a web app manifest, meeting all the Progressive Web App criteria. (Note: Using the service worker is opt-in as of [email protected] and higher)
  • Hassle-free updates for the above tools with a single dependency.

Check out this guide for an overview of how these tools fit together.

The tradeoff is that these tools are preconfigured to work in a specific way. If your project needs more customization, you can "eject" and customize it, but then you will need to maintain this configuration.

Popular Alternatives

Create React App is a great fit for:

  • Learning React in a comfortable and feature-rich development environment.
  • Starting new single-page React applications.
  • Creating examples with React for your libraries and components.

Here are a few common cases where you might want to try something else:

  • If you want to try React without hundreds of transitive build tool dependencies, consider using a single HTML file or an online sandbox instead.

  • If you need to integrate React code with a server-side template framework like Rails, Django or Symfony, or if youโ€™re not building a single-page app, consider using nwb, or Neutrino which are more flexible. For Rails specifically, you can use Rails Webpacker. For Symfony, try Symfony's webpack Encore.

  • If you need to publish a React component, nwb can also do this, as well as Neutrino's react-components preset.

  • If you want to do server rendering with React and Node.js, check out Next.js or Razzle. Create React App is agnostic of the backend, and only produces static HTML/JS/CSS bundles.

  • If your website is mostly static (for example, a portfolio or a blog), consider using Gatsby or Next.js. Unlike Create React App, Gatsby pre-renders the website into HTML at build time. Next.js supports both server rendering and pre-rendering.

  • Finally, if you need more customization, check out Neutrino and its React preset.

All of the above tools can work with little to no configuration.

If you prefer configuring the build yourself, follow this guide.

React Native

Looking for something similar, but for React Native?
Check out Expo CLI.

Contributing

We'd love to have your helping hand on create-react-app! See CONTRIBUTING.md for more information on what we're looking for and how to get started.

Supporting Create React App

Create React App is a community maintained project and all contributors are volunteers. If you'd like to support the future development of Create React App then please consider donating to our Open Collective.

Credits

This project exists thanks to all the people who contribute.

Thanks to Netlify for hosting our documentation.

Acknowledgements

We are grateful to the authors of existing related projects for their ideas and collaboration:

License

Create React App is open source software licensed as MIT. The Create React App logo is licensed under a Creative Commons Attribution 4.0 International license.

More Repositories

1

react

The library for web and native user interfaces.
JavaScript
215,591
star
2

react-native

A framework for building native applications using React
Java
112,730
star
3

docusaurus

Easy to maintain open source documentation websites.
TypeScript
45,490
star
4

jest

Delightful JavaScript Testing.
TypeScript
41,554
star
5

rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
C++
26,307
star
6

folly

An open-source C++ library developed and used at Facebook.
C++
26,239
star
7

flow

Adds static typing to JavaScript to improve developer productivity and code quality.
OCaml
22,017
star
8

zstd

Zstandard - Fast real-time compression algorithm
C
20,959
star
9

relay

Relay is a JavaScript framework for building data-driven React applications.
Rust
17,967
star
10

hhvm

A virtual machine for executing programs written in Hack.
C++
17,796
star
11

fresco

An Android library for managing images and the memory they use.
Java
16,998
star
12

yoga

Yoga is a cross-platform layout engine which implements Flexbox. Follow https://twitter.com/yogalayout for updates.
C++
16,435
star
13

lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
JavaScript
15,961
star
14

prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
Python
15,955
star
15

infer

A static analyzer for Java, C, C++, and Objective-C
OCaml
14,347
star
16

flipper

A desktop debugging platform for mobile developers.
TypeScript
12,645
star
17

watchman

Watches files and records, or triggers actions, when they change.
C++
11,979
star
18

react-devtools

An extension that allows inspection of React component hierarchy in the Chrome and Firefox Developer Tools.
11,028
star
19

chisel

Chisel is a collection of LLDB commands to assist debugging iOS apps.
Python
9,023
star
20

hermes

A JavaScript engine optimized for running React Native.
C++
8,612
star
21

jscodeshift

A JavaScript codemod toolkit.
JavaScript
8,593
star
22

buck

A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
Java
8,570
star
23

proxygen

A collection of C++ HTTP libraries including an easy to use HTTP server.
C++
7,893
star
24

facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
Swift
7,528
star
25

litho

A declarative framework for building efficient UIs on Android.
Java
7,499
star
26

pyre-check

Performant type-checking for python.
OCaml
6,356
star
27

facebook-android-sdk

Used to integrate Android apps with Facebook Platform.
Kotlin
5,932
star
28

redex

A bytecode optimizer for Android apps
C++
5,897
star
29

componentkit

A React-inspired view framework for iOS.
Objective-C++
5,723
star
30

sapling

A Scalable, User-Friendly Source Control System.
Rust
5,111
star
31

fishhook

A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS.
C
4,995
star
32

PathPicker

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything. After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands.
Python
4,953
star
33

metro

๐Ÿš‡ The JavaScript bundler for React Native.
JavaScript
4,724
star
34

prop-types

Runtime type checking for React props and similar objects
JavaScript
4,299
star
35

idb

idb is a flexible command line interface for automating iOS simulators and devices
Objective-C
4,272
star
36

Haxl

A Haskell library that simplifies access to remote data, such as databases or web-based services.
Haskell
4,204
star
37

FBRetainCycleDetector

iOS library to help detecting retain cycles in runtime.
Objective-C++
4,155
star
38

memlab

A framework for finding JavaScript memory leaks and analyzing heap snapshots
TypeScript
4,013
star
39

duckling

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.
Haskell
3,898
star
40

fbt

A JavaScript Internationalization Framework
JavaScript
3,806
star
41

regenerator

Source transformer enabling ECMAScript 6 generator functions in JavaScript-of-today.
JavaScript
3,766
star
42

mcrouter

Mcrouter is a memcached protocol router for scaling memcached deployments.
C++
3,158
star
43

buck2

Build system, successor to Buck
Rust
3,009
star
44

wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
C++
3,000
star
45

wdt

Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.
C++
2,815
star
46

igl

Intermediate Graphics Library (IGL) is a cross-platform library that commands the GPU. It provides a single low-level cross-platform interface on top of various graphics APIs (e.g. OpenGL, Metal and Vulkan).
C++
2,577
star
47

fbthrift

Facebook's branch of Apache Thrift, including a new C++ server.
C++
2,486
star
48

mysql-5.6

Facebook's branch of the Oracle MySQL v5.6 database. This includes MyRocks.
C++
2,377
star
49

Ax

Adaptive Experimentation Platform
Python
2,173
star
50

jsx

The JSX specification is a XML-like syntax extension to ECMAScript.
HTML
1,924
star
51

fbjs

A collection of utility libraries used by other Meta JS projects.
JavaScript
1,921
star
52

react-native-website

The React Native website and docs
JavaScript
1,830
star
53

screenshot-tests-for-android

Generate fast deterministic screenshots during Android instrumentation tests
Java
1,715
star
54

idx

Library for accessing arbitrarily nested, possibly nullable properties on a JavaScript object.
JavaScript
1,688
star
55

TextLayoutBuilder

An Android library that allows you to build text layouts more easily.
Java
1,459
star
56

SoLoader

Native code loader for Android
Java
1,249
star
57

facebook-python-business-sdk

Python SDK for Meta Marketing APIs
Python
1,151
star
58

ThreatExchange

Trust & Safety tools for working together to fight digital harms.
C++
1,063
star
59

mariana-trench

A security focused static analysis tool for Android and Java applications.
C++
1,007
star
60

fatal

Fatal is a library for fast prototyping software in modern C++. It provides facilities to enhance the expressive power of C++. The library is heavily based on template meta-programming, while keeping the complexity under-the-hood.
C++
988
star
61

transform360

Transform360 is an equirectangular to cubemap transform for 360 video.
C
983
star
62

CacheLib

Pluggable in-process caching engine to build and scale high performance services
C++
967
star
63

openr

Distributed platform for building autonomic network functions.
C++
858
star
64

fboss

Facebook Open Switching System Software for controlling network switches.
C++
829
star
65

facebook-php-business-sdk

PHP SDK for Meta Marketing API
PHP
761
star
66

ktfmt

A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
Kotlin
724
star
67

winterfell

A STARK prover and verifier for arbitrary computations
Rust
663
star
68

pyre2

Python wrapper for RE2
C++
618
star
69

openbmc

OpenBMC is an open software framework to build a complete Linux image for a Board Management Controller (BMC).
C
594
star
70

SPARTA

SPARTA is a library of software components specially designed for building high-performance static analyzers based on the theory of Abstract Interpretation.
C++
572
star
71

chef-cookbooks

Open source chef cookbooks.
Ruby
556
star
72

IT-CPE

Meta's Client Platform Engineering tools. Some of the tools we have written to help manage our fleet of client systems.
Ruby
548
star
73

time

Meta's Time libraries
Go
463
star
74

facebook-sdk-for-unity

The facebook sdk for unity.
C#
457
star
75

lexical-ios

Lexical iOS is an extensible text editor framework that integrates the APIs and philosophies from Lexical Web with a Swift API built on top of TextKit.
Swift
422
star
76

facebook-nodejs-business-sdk

Facebook Ads API using Node.js
JavaScript
414
star
77

FAI-PEP

Facebook AI Performance Evaluation Platform
Python
374
star
78

Rapid

The OpenStreetMap editor driven by open data, AI, and supercharged features
JavaScript
371
star
79

facebook-java-business-sdk

Java SDK for Meta Marketing APIs
Java
368
star
80

chef-utils

Utilities related to Chef
Ruby
286
star
81

opaque-ke

An implementation of the OPAQUE password-authenticated key exchange protocol
Rust
252
star
82

dns

Collection of Meta's DNS Libraries
Go
248
star
83

facebook360_dep

Facebook360 Depth Estimation Pipeline - https://facebook.github.io/facebook360_dep
HTML
235
star
84

akd

An implementation of an auditable key directory
Rust
198
star
85

tac_plus

A Tacacs+ Daemon tested on Linux (CentOS) to run AAA via TACACS+ Protocol via IPv4 and IPv6.
C
194
star
86

facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
Ruby
193
star
87

pcicrawler

pcicrawler is a Python based command line interface tool which can be used to display, filter and export information about PCI (Peripheral Component Interconnect) or PCIe buses and devices, as well as PCI topology.
Python
161
star
88

usort

Safe, minimal import sorting for Python projects.
Python
153
star
89

grocery-delivery

The Grocery Delivery utility for managing cookbook uploads to distributed Chef backends.
Ruby
150
star
90

taste-tester

Software to manage a chef-zero instance and use it to test changes on production servers.
Ruby
143
star
91

TestSlide

A Python test framework
Python
137
star
92

homebrew-fb

OS X Homebrew formulas to install Meta open source software
Ruby
120
star
93

sapp

Post Processor for Facebook Static Analysis Tools.
Python
118
star
94

squangle

SQuangLe is a C++ API for accessing MySQL servers
C++
118
star
95

malware-detection

Sharing indicators and methods for malware and malicious activity detection and prevention to help keep the Internet safe
Python
96
star
96

ocamlrep

Sets of libraries and tools to write applications and libraries mixing OCaml and Rust. These libraries will help keeping your types and data structures synchronized, and enable seamless exchange between OCaml and Rust
Starlark
94
star
97

facebook-business-sdk-codegen

Codegen project for our business SDKs
PHP
69
star
98

fb303

fb303 is a core set of thrift functions that provide a common mechanism for querying stats and other information from a service.
C++
69
star
99

bpfilter

BPF-based packet filtering framework
C
56
star
100

between-meals

A library to provide calculations between Chef diffs.
Ruby
56
star