Components 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 Components flashcards as text
What is the children prop in React?
Answer: The content placed between the opening and closing tags of a component, accessible via props.children
props.children contains whatever is placed between a component's opening and closing tags, enabling component composition patterns.
What is conditional rendering in React?
Answer: Showing different UI elements based on conditions using JavaScript operators like if, ternary, or &&
Conditional rendering uses JavaScript logic within JSX to determine which elements to display based on state, props, or other conditions.
What is a controlled component?
Answer: A form element whose value is controlled by React state rather than the DOM
In controlled components, React state is the single source of truth for form inputs. Every change updates state, and state drives what is displayed.
What is prop drilling?
Answer: Passing props through multiple intermediate components that do not need them, just to reach a deeply nested child
Prop drilling occurs when data must pass through many component layers. Solutions include Context API, state management libraries, or component composition.
What are keys in React lists?
Answer: Unique identifiers that help React identify which list items have changed, been added, or removed
Keys help React's reconciliation algorithm efficiently update lists by identifying individual elements. They should be stable, unique, and predictable.
What is a React fragment?
Answer: A wrapper (<> or ) that groups multiple elements without adding extra DOM nodes
Fragments let you group multiple children without adding unnecessary wrapper divs to the DOM, keeping the HTML structure clean.
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