Understanding React, Flux, and Redux: A Frontend Architecture Guide
This article explains how React renders views, introduces Flux as a unified state‑management architecture, and compares Redux's single‑store, reducer‑based approach, highlighting their core components, data flow, and practical differences for modern frontend development.
React
React is a view‑layer framework used to render UI. It mainly provides:
Componentization
One‑way data flow via props View updates driven by state changes
Virtual DOM to improve rendering performance
State changes are usually triggered by user interactions on the page. Each component has a setState method to modify its own state, but as applications grow, managing the relationship between many states and many views becomes difficult.
Flux
Flux is an application architecture (or mindset) that can be used with React or other frameworks. It centralizes the handling of all actions that cause state changes. Flux maintains one or more Store objects (similar to the Model in MVC) that hold all application data.
When an event occurs, Flux processes the event, updates the relevant Store, and the root (or controller) view reads the new Store data, updates its state, and passes the new state down through React’s one‑way data flow to refresh the UI.
Flux’s conceptual model:
Flux consists of four parts: Dispatcher, Store, View, and Action. The Dispatcher is the core hub that receives Actions, distributes them to all registered Stores, and triggers Store change events. Controller‑views listen for these changes, fetch updated data from the Stores, call setState, and re‑render themselves and their descendants. This centralization makes testing easier because actions can be fabricated and dispatched without a real UI event.
Redux
Redux serves the same purpose as Flux but implements it differently.
1. Single Store – Redux consolidates multiple stores into a single global store, from which the entire application state can be derived. Update logic resides in pure functions called reducers rather than inside the store itself.
2. No Dispatcher – Redux replaces the Dispatcher with reducers. A reducer is a pure function expressed as (previousState, action) => newState. Multiple reducers manage different slices of the state tree and are combined with combineReducers into a root reducer that produces the new global state.
When an Action is dispatched, the store calls each reducer; the reducers return a new state, which the store then provides to the view layer.
Key visual differences:
Flux store structure:
Redux store (or reducer) structure:
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Tencent IMWeb Frontend Team
IMWeb Frontend Community gathering frontend development enthusiasts. Follow us for refined live courses by top experts, cutting‑edge technical posts, and to sharpen your frontend skills.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
