State Management Flashcards
6 cards from real React practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 State Management flashcards as text
What is lifting state up in React?
Answer: Moving shared state to the closest common ancestor component so multiple children can access it
When multiple components need the same data, the state is moved to their nearest common parent, which passes it down via props.
What is the Context API?
Answer: A React feature for sharing data globally across components without passing props through every level
Context provides a way to share values (like themes, user data, preferences) across the component tree without explicit prop passing at every level.
What is useReducer?
Answer: A hook for managing complex state logic with a reducer function, similar to Redux patterns
useReducer is an alternative to useState for complex state logic. It uses a reducer function that takes current state and an action, returning new state.
What triggers a re-render in React?
Answer: State changes via setState/useState, parent re-renders passing new props, or context value changes
React re-renders when state changes, when a parent passes different props, or when consumed context values change. This triggers reconciliation with the virtual DOM.
What is immutability in React state?
Answer: The practice of creating new objects/arrays instead of modifying existing ones when updating state
React relies on reference comparison to detect changes. Mutating state directly does not trigger re-renders. Creating new objects/arrays ensures React detects the change.
What is Redux?
Answer: A predictable state management library using a single store, actions, and reducers for managing application state
Redux centralizes application state in a single store. Components dispatch actions that are processed by reducers to produce new state, making state changes predictable.
Written and edited by Nathan Beja, founder of Practice Test Geeks, with AI assistance. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Editorial policy