"React family bucket" usually refers to the most commonly used set in addition to the React core library when developing large and complex React projects. Official or community recognized standard technology stack 。
For a more intuitive understanding, we can divide them into the following core parts:
1. Core bottom layer: React Core
This is the basis for all development.
- React: Core library responsible for componentization and virtual DOM.
- React-DOM: Responsible for rendering components into the browser's real DOM environment.
2. Route management: React Router
In a single page application (SPA), we need to switch page components according to URL changes without refreshing the entire page.
- React Router DOM: The current standard choice (usually using v6+ versions).It provides
BrowserRouter,Routes,Route,Linkand other components to manage front-end routing.
3. Status management: Store
When multiple components need to share data (such as logged in user information, shopping cart status), relying solely on props passing between components will become very painful.
- Redux / Redux Toolkit (RTK): The most classic and ecologically rich state management library.It is now officially recommended to use Redux Toolkit, which greatly simplifies the lengthy writing of Redux.
- Zustand: A lightweight state management library that has been very popular in the past two years. It is very fast to get started and is loved by developers.
- MobX: Responsive programming style state management, suitable for teams that prefer object-oriented development.
4. Asynchronous requests: Data Fetching
Although you can use native fetch or Axios, FamilyBucket usually introduces tools that specifically handle the request life cycle (caching, loading, error handling).
- TanStack Query (React Query): Currently a community-recognized artifact that specializes in handling asynchronous server status.
- RTK Query: If you use Redux Toolkit, the plug-in that comes with it is also very powerful.
- Axios: The most basic Promise request library.
5. Component Library: UI Framework
In order to improve development efficiency, mature UI components are usually used directly.
- Ant Design (Antd): The first choice for enterprise-level backend management systems (with a strong domestic ecosystem).
- MUI (Material UI): The world's most popular UI library, following Google design specifications.
- Shadcn UI / Tailwind CSS: A very popular styling solution focusing on high customization.
6. Scaffolding and building tools
How to quickly set up a development environment for all the above tools?
- Vite: Currently the most mainstream front-end construction tool with extremely fast startup speed.
- Next.js: The "ultimate form" of React Family Bucket.It is a framework with built-in routing, SSR (server-side rendering), optimization and other functions. It is currently the officially recommended development method of React.
Summary comparison table
| Category | Recommended Plan (Mainstream) | Alternative Plan |
|---|---|---|
| Routing | React Router v6 | Next.js (built-in) |
| State Management | Redux Toolkit / Zustand | MobX / Recoil |
| Styles | Tailwind CSS/Ant Design | CSS Modules/Styled-components |
| Data Request | TanStack Query/Axios | SWR |
| Build Tools | Vite | Webpack (CRA deprecated) |