📌
My Docs
React
React
  • General Notes
    • index
    • Review-Of-Previous-Concepts
    • Reiew
    • Spread and Rest
    • Understanding By Example
    • React-Resources
    • Using Web Components in React
    • Thinking in React
    • Hello World
    • REACT ENVIORMENT
    • Components And Props
    • Composition vs Inheritance
    • JSX
    • Advanced
    • Project Examples
    • Node.js versus Next.js - A React Approach
    • Composition vs Inheritance
    • React Components
    • Docs
    • Prerequisites
      • Callbacks
      • Scope
      • Mutability
      • Array-CB-Methods
      • Objects
      • Glossary
    • index
    • Question Set #1:
    • Website
    • Editor Setup
    • Quick Start
    • JavaScript in JSX with Curly Braces
    • Your First Component
    • Reducer
    • Passing Data Deeply with Context
    • Manipulating the DOM with Refs
    • Rendering Lists
    • Choosing the State Structure
    • Tips
  • Udemy React & Redux
    • JSX
    • Modern+React+With+Redux
    • Examples
  • Articles
    • Introduction to React for Complete Beginners
    • A Comprehensive Deep Dive into React
    • Super Simple Intro To React
    • Basic React Tutorial
  • REACT DOCS
    • Shallow Compare
    • Performance Tools
    • Keyed Fragments
    • Test Utilities
    • Code-Splitting
    • Introducing Concurrent Mode (Experimental)
    • Components and Props
    • Concurrent Mode API Reference (Experimental)
    • Conditional Rendering
    • Suspense for Data Fetching (Experimental)
    • Cross-origin Errors
    • Error Decoder
    • Error Boundaries
    • New React App
    • Passing Functions to Components
    • recommended way to structure React projects?
    • Forms
    • Fragments
    • Getting Started
    • Versioning Policy
    • Add-Ons
    • Rules of Hooks
    • Using the State Hook
    • How to Contribute
    • Introducing JSX
    • JSX In Depth
    • Event Pooling
    • Portals
    • Optimizing Performance
    • React Without ES6
    • SyntheticEvent
    • PureRenderMixin
    • ReactDOMServer
    • Profiler API
    • Test Renderer
    • Refs and the DOM
    • Static Type Checking
    • State and Lifecycle
    • Uncontrolled Components
    • Web Components
    • PureRenderMixin
Powered by GitBook
On this page
  • You Might Not Need a Toolchain
  • Recommended Toolchains
  • Creating a Toolchain from Scratch

Was this helpful?

  1. REACT DOCS

New React App

Use an integrated toolchain for the best user and developer experience.

This page describes a few popular React toolchains which help with tasks like:

  • Scaling to many files and components.

  • Using third-party libraries from npm.

  • Detecting common mistakes early.

  • Live-editing CSS and JS in development.

  • Optimizing the output for production.

The toolchains recommended on this page don't require configuration to get started.

You Might Not Need a Toolchain

If you don't experience the problems described above or don't feel comfortable using JavaScript tools yet, consider adding React as a plain <script> tag on an HTML page, optionally with JSX.

This is also the easiest way to integrate React into an existing website. You can always add a larger toolchain if you find it helpful!

Recommended Toolchains

The React team primarily recommends these solutions:

  • If you're learning React or creating a new single-page app, use Create React App.

  • If you're building a server-rendered website with Node.js, try Next.js.

  • If you're building a static content-oriented website, try Gatsby.

  • If you're building a component library or integrating with an existing codebase, try More Flexible Toolchains.

Create React App

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

Note

Next.js

Gatsby

More Flexible Toolchains

The following toolchains offer more flexibility and choice. We recommend them to more experienced users:

Creating a Toolchain from Scratch

A JavaScript build toolchain typically consists of:

Don't forget to ensure your custom toolchain is correctly set up for production.

PreviousError BoundariesNextPassing Functions to Components

Last updated 3 years ago

Was this helpful?

is a comfortable environment for learning React, and is the best way to start building a new single-page application in React.

It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production. You’ll need to have on your machine. To create a project, run:

npx on the first line is not a typo -- it's a .

Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want. Under the hood, it uses and , but you don't need to know anything about them.

When you're ready to deploy to production, running npm run build will create an optimized build of your app in the build folder. You can learn more about Create React App and the .

is a popular and lightweight framework for static and server‑rendered applications built with React. It includes styling and routing solutions out of the box, and assumes that you're using as the server environment.

Learn Next.js from .

is the best way to create static websites with React. It lets you use React components, but outputs pre-rendered HTML and CSS to guarantee the fastest load time.

Learn Gatsby from and a .

combines the power of with the simplicity of presets, and includes a preset for and .

is a toolkit for full-stack monorepo development, with built-in support for React, Next.js, , and more.

is a fast, zero configuration web application bundler that .

is a server-rendering framework that doesn't require any configuration, but offers more flexibility than Next.js.

A package manager, such as or . It lets you take advantage of a vast ecosystem of third-party packages, and easily install or update them.

A bundler, such as or . It lets you write modular code and bundle it together into small packages to optimize load time.

A compiler such as . It lets you write modern JavaScript code that still works in older browsers.

If you prefer to set up your own JavaScript toolchain from scratch, that re-creates some of the Create React App functionality.

Create React App
Node >= 14.0.0 and npm >= 5.6
package runner tool that comes with npm 5.2+
Babel
webpack
from its README
User Guide
Next.js
Node.js
its official guide
Gatsby
its official guide
gallery of starter kits
Neutrino
webpack
React apps
React components
Nx
Express
Parcel
works with React
Razzle
Yarn
npm
webpack
Parcel
Babel
check out this guide