React Fundamentals: Components, Hooks & State Management
React Fundamentals: Components, Hooks & State Management
Up to 20 questions, shuffled on every run
Welcome to the React Fundamentals Quiz! This quiz will test your knowledge of core React concepts, including components, JSX, hooks, state management, props, and event handling. Whether you’re new to React or looking to solidify your understanding of the basics, this quiz is designed to challenge you and help you master the fundamentals of building modern interactive UIs with React. Good luck!
Answer key and explanations20 questions
The quiz above draws 20 questions at random from these 31, so a second attempt will not be the same run. Everything in the pool is listed here.
What is JSX?
AnswerA syntax extension that allows writing HTML-like code within JavaScript
What is a React component?
AnswerA reusable JavaScript function or class that returns a JSX structure
What is a functional component vs. class component?
AnswerFunctional components use hooks; class components use lifecycle methods
What are props in React?
AnswerRead-only data passed from a parent component down to a child component
What is React state?
AnswerInternal data managed by a component that triggers updates when changed
What is useState hook?
AnswerA hook used to add and manage local state within functional components
What is useEffect hook?
AnswerA hook used for handling side effects like data fetching or DOM updates
What is the dependency array in useEffect?
AnswerA list of values that determines when the effect should re-run its logic
What is event handling in React?
AnswerThe process of attaching functions to UI events like onClick or onChange
What is conditional rendering in React?
AnswerDisplaying specific JSX based on logic using ternary or logical operators
What is list rendering in React?
AnswerGenerating multiple UI elements from an array using the .map() method
What are keys in React lists?
AnswerUnique identifiers that help React track and update specific list items
What is the virtual DOM in React?
AnswerAn in-memory representation of the DOM used to calculate efficient updates
What is lifting state up?
AnswerMoving shared state to a common parent component to sync sibling data
What are controlled components?
AnswerForm elements whose values are managed and updated by React state
What is React Context?
AnswerAn API for sharing state across the component tree without prop drilling
What is component composition?
AnswerDesigning UIs by combining multiple smaller components into a larger unit
What is React lazy loading / code splitting?
AnswerAsynchronously loading components only when they are needed by the user
What is React Fragment?
AnswerA tool for grouping multiple elements without adding extra nodes to the DOM
What is React StrictMode?
AnswerA development tool that highlights potential problems in an application
What is the React developer tools?
AnswerA browser extension for inspecting the component tree and tracking state
What is React reconciliation?
AnswerThe algorithm React uses to diff the virtual DOM and update the real DOM
What is the key difference between React and vanilla JavaScript?
AnswerReact is declarative (UI-focused) while vanilla JS is imperative (DOM-focused)
What is useCallback hook?
AnswerA hook that memoizes functions to prevent unnecessary child re-renders
What is useMemo hook?
AnswerA hook that memoizes expensive calculations to avoid repeating them
What is useRef hook?
AnswerA hook for creating persistent references that do not trigger re-renders
What are custom hooks?
AnswerFunctions that combine built-in hooks to share logic between components
What is React.memo?
AnswerA higher-order component that prevents re-rendering if props are unchanged
What are PropTypes?
AnswerA library for checking the data types of props during the app runtime
What is an Error Boundary?
AnswerA class component that catches JavaScript errors in its child components
What is the purpose of React Suspense?
AnswerA component that shows a fallback UI while waiting for content to load








