Redux toolkit
🧠What is Redux Toolkit? Redux Toolkit is the official, recommended way to use Redux — a tool that helps you manage global state in React apps. Component State (Local State) Belongs to one specific component. It’s used when only that component needs to know or control that data. Example: Imagine a light switch component in a room. The switch ON/OFF is tracked inside that component only — no other part of the house (app) needs to know about it. function LightSwitch() { const [isOn, setIsOn] = useState(false); return <button onClick={() => setIsOn(!isOn)}>{isOn ? 'ON' : 'OFF'}</button>; } Global State This is shared state — data that multiple components need to access or update. It’s stored in a central place and can be used across the app. Example: Imagine an app with a theme toggle (dark/light mode) that affects the whole app — not just one component. If you stored this in just one component, others wouldn’t know when it changes. So, you use globa...