Redux is a state management library used in React applications to manage and share data between components.
It helps when:
- Many components need the same data
- Data changes frequently
- Props drilling becomes difficult
Redux stores all common data in one central place called: Store
Any component can access data directly from the store.
Install Redux:
npm install @reduxjs/toolkit react-redux
Q1. What is Redux?
Redux is a state management library for JavaScript applications.
Q2. What is Store?
Store is the central place where application state is stored.
Q3. What is Action?
Action is an object that describes what happened.
Q4. What is Reducer?
Reducer is a function that updates state based on action.
Q5. What is Dispatch?
Dispatch sends action to reducer.
Q6. What is Redux Toolkit?
Redux Toolkit is the official modern way to write Redux code.