Skip to main content
InterviewHubPRO
Section Overview
Q114

Question 114 of 407

Part 5: React Redux State Management (101 - 134)

28%
React Core & Hooks (407 Qs)•Part 5: React Redux State Management (101 - 134)

Should I keep all component's state in Redux store?

mid LevelMost AskedCode ExampleComponentsState Management

Keep your data in the Redux store, and the UI related state internally in the component.

Practical Code Example

jsx
// Rule of Thumb: Only store truly global, shared state in Redux:
// Local UI State (Keep in component):
const [isDropdownOpen, setIsDropdownOpen] = useState(false);

// Global Shared State (Store in Redux):
const currentUser = useSelector((state) => state.auth.user);