PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

React · Theory

Redux in React

← All stacks

Theory

39/94

Redux in React

Redux is a predictable state container: one store, reducers are pure (state, action) => newState, you dispatch actions. UI subscribes. It’s Flux-shaped. You do not need Redux for a counter. You consider it when many distant screens share complex state (cart + checkout + admin) and you want time-travel/debug tools.

Modern Redux: Redux Toolkit (configureStore, createSlice). Don’t teach 2016 switch-statement boilerplate as ‘how we write Redux now’. Context+useReducer can cover smaller apps.

Redux in React — output — 1. dispatch({type:'inc'}) → reducer → new state → UI. Never mutate the old state.

Diagram
view click
      │ dispatch
      ▼
   reducer
      │ new state
      ▼
     store → UI
Exam tip

When Redux vs useState/Context. Mention RTK.

Example

// Redux idea
function reducer(state, action) {
  if (action.type === "inc") return { n: state.n + 1 };
  return state;
}
let state = { n: 0 };
state = reducer(state, { type: "inc" });
console.log(state.n);

Redux in React — output: 1. dispatch({type:'inc'}) → reducer → new state → UI. Never mutate the old state.

Short notes

  • Defstore + pure reducer + dispatch.
  • Now : Redux Toolkit.
  • Skip : tiny local state.

Questions

1

Must every React app use Redux?

2

What must a reducer not do?

Previous← Flux vs MVCNextRedux Example →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.