What are React and ReactJS

Create a new React application

Use built-in tool chains for the best user and developer experience.

This page describes some popular tools for React that will help with tasks such as:

  • Scale to many files and components.
  • Use third party libraries from npm.
  • Recognize common mistakes early.
  • Edit CSS and JS live during development.
  • Optimize the output for the production environment.

The tools recommended on this page don't need any configuration to get started.

You may not need any tools

If you are not familiar with the problems described above or are not yet comfortable using JavaScript tools, consider adding React as a simple tag to an HTML page, optionally with JSX.

This is also the easiest way to integrate React into an existing website. If you find it helpful, you can always add a larger collection of tools!

Recommended tools

The React Team recommends these solutions:

  • If you Learning to react or a new single page application then use Create React App.
  • If you have a webpage rendered by the server with Node.js build, then try Next.js.
  • If you have a Build a static content-oriented websitethen try Gatsby.
  • If you have a Component library build or integrate with an existing code base, then try more flexible tools.

Create React App

Create React App is a convenient environment to To learn React and is the best way to be with a new single page application to start in React.

It sets up your development environment so that you can use the latest JavaScript functions, offers a better development experience and optimizes your app for production. For this you need Node> = 10.16 and npm> = 5.6 on your computer. To create a project, run the following commands:

Note

There is no typo in the first line - it is a tool to run packages directly (package runner tool), which has been included since npm 5.2

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 Babel and webpack, but you don't need to know anything about that.

When you are ready to deploy to the production environment, run. This will create a streamlined build for your application in the folder. You can learn more about Create React App in the README and user manual.

Next.js

Next.js is a popular and lightweight framework for React built, static and server-rendered applications. It contains Styling and routing solutions out of the box and assumes that you are using Node.js as the server environment.

Learn Next.js through the official guide.

Gatsby

Gatsby is the best way to get started with React static websites to create. It lets you use React components, but generates pre-rendered HTML and CSS to guarantee the fastest possible loading time.

Get to know Gatsby through the official guide and a gallery of starter kits.

More flexible tools

The following tools offer more flexibility and freedom. We recommend them for more experienced users:

  • neutrino combines the strength of webpack with the simplicity of presets and comes with a preset for React applications and React components.
  • Nx is a toolkit for full-stack monorepo development, with built-in support for React, Next.js, Express and more.
  • Parcel is a fast, configuration-free bundler for web applications that works with React.
  • Razzle is a framework for server rendering. It doesn't require any configuration, but it offers more flexibility than Next.js.

Build a tool chain from scratch

Typically a JavaScript build tool chain consists of:

  • One Package manager like yarn or npm. This gives you access to a wide ecosystem of third-party libraries that you can easily install or update.
  • One Bundler like webpack or Parcel. This allows you to write modular code and pack it into small packages to optimize loading time.
  • One Compiler like Babel. Allows you to write modern JavaScript code that still works in old browsers.

If you prefer to build your own JavaScript tool chain from scratch, check out this guide, which recreates some of the functionality of Create React App.

Don't forget to make sure that your own tool chain is set up correctly for the production environment.