Use an integrated toolchain for the quality user and developer experience.
This web page describes a few popular React toolchains which assist with responsibilities like:
- Scaling to many files and components.
- Using 1/3-birthday celebration libraries from npm.
- Detecting not unusual errors early.
- Live-modifying CSS and JS in development.
- Optimizing the output for production.
The toolchains advocated on this page don’t require configuration to get started out.
This is also the very best way to combine React into an current website. You can continually upload a larger toolchain if you discover it helpful!
The React crew usually recommends those answers:
- If you’re mastering React or developing a new unmarried-web page app, use Create React App.
- If you’re building a server-rendered internet site with Node.js, strive Next.js.
- If you’re building a static content-orientated internet site, strive Gatsby.
- If you’re constructing a issue library or integrating with an current codebase, attempt More Flexible Toolchains.
Create React App is a cushty surroundings for mastering React, and is the first-rate manner to start building a new single-page application in React.
npx create-react-app my-app
npx on the first line is not a typo — it’s a package deal runner device that incorporates npm five.2+.
Create React App doesn’t handle backend good judgment or databases; it just creates a frontend build pipeline, so that you can use it with any backend you need. Under the hood, it uses Babel and webpack, but you don’t want to recognize something about them.
When you’re prepared to installation to production, running npm run construct will create an optimized build of your app within the construct folder. You can study more about Create React App from its README and the User Guide.
Next.js is a famous and light-weight framework for static and server‑rendered applications constructed with React. It includes styling and routing answers out of the field, and assumes that you’re the use of Node.js because the server environment.
Learn Next.js from its legit guide.
Gatsby is the fine manner to create static web sites with React. It lets you use React additives, however outputs pre-rendered HTML and CSS to assure the quickest load time.
Learn Gatsby from its legitimate manual and a gallery of starter kits.
The following toolchains offer greater flexibility and preference. We advocate them to greater skilled customers:
- Neutrino combines the strength of webpack with the simplicity of presets, and consists of a preset for React apps and React additives.
- Nx is a toolkit for full-stack monorepo improvement, with built-in aid for React, Next.js, Express, and more.
- Parcel is a quick, zero configuration net application bundler that works with React.
- Razzle is a server-rendering framework that doesn’t require any configuration, however gives greater flexibility than Next.js.
- A package supervisor, inclusive of Yarn or npm. It helps you to take advantage of a sizeable surroundings of third-birthday celebration applications, and effortlessly install or replace them.
- A bundler, together with webpack or Parcel. It helps you to write modular code and package it together into small programs to optimize load time.
Don’t overlook to make certain your custom toolchain is efficaciously installation for manufacturing.