120 original practice questions across 21 topics, every answer explained. Study mode shows the reasoning as you go; test mode holds it until the end.
120 questions
What does JSX compile to?
Why must a component name start with a capital letter?
What is the virtual DOM?
Which statement about React's reconciliation is correct?
Why is className used instead of class in JSX?
What does a React Fragment do?
When do you need to use <React.Fragment> instead of the shorthand <>?
What does {0 && <Message />} render?
How does React protect against XSS in JSX expressions?
Which is the correct way to write an inline style in JSX?
What is the primary difference between a controlled and an uncontrolled component?
What are props in React?
What is children in the context of props?
What problem does prop drilling describe?
What does a pure component guarantee?
Why does React StrictMode double-invoke component render functions in development?
What is a Higher-Order Component (HOC)?
What is the render props pattern?
How do you provide a default value for a prop in a function component?
In React 19, how do you access a ref passed to a function component?
What does useImperativeHandle do?
What is the purpose of React.memo?
Why might React.memo fail to prevent a re-render even when the data appears unchanged?
What does a component return to render nothing at all?
What does the spread operator do in <Button {...props} />?
Can a child component modify a prop it receives?
What happens if you mutate an object that was passed as a prop?
What is the modern replacement for PropTypes in most codebases?
What is the purpose of the key prop when rendering a list?
Why is using the array index as a key problematic?
When is using the array index as a key acceptable?
Where must a key be placed when mapping over an array?
What happens when you change the key on a component?
What is a SyntheticEvent?
Where does React 18 attach its event listeners?
How do you prevent a form's default submit behavior in React?
What is wrong with onClick={handleClick()} in JSX?
In React 19, what does the new form action prop enable?
Which handler fires on every keystroke in a React text input?
Why does React warn when an input's value changes from undefined to a defined value?
What does useState return?
Why does calling setCount(count + 1) three times in a row only increment by one?
What is the correct way to update an object stored in state?
What does passing a function to useState, as in useState(() => expensiveInit()), accomplish?
Is a state update applied immediately after calling the setter?
What changed about automatic batching in React 18?
What is lifting state up?
Why should derived values generally not be stored in state?
When does useEffect run by default with no dependency array?
What does returning a function from useEffect do?
Why does useEffect run twice on mount in React 18 development?
What is the difference between useEffect and useLayoutEffect?
What causes an infinite loop in useEffect?
Why can the useEffect callback not be declared async directly?
How do you prevent a race condition when fetching data in useEffect?
Which of these is NOT a good use case for useEffect?
What does the useEffectEvent hook (experimental) address?
What are the Rules of Hooks?
What does useRef return?
What is the key behavioral difference between useRef and useState?
What does useMemo do?
What is the relationship between useCallback and useMemo?
When does useCallback provide no benefit?
What does useContext do?
What is the main performance pitfall of Context?
When is useReducer preferable to useState?
What is the signature of the reducer function passed to useReducer?
What does useSyncExternalStore solve?
What does useId generate?
What defines a custom hook?
If two components call the same custom hook, do they share state?
What does useDeferredValue do?
What does useTransition return?
What is the React 19 use API?
What does useOptimistic enable?
What does useFormStatus provide?
What does the exhaustive-deps ESLint rule warn about?
What is a stale closure in React?
Can hooks be called inside a class component?
Which lifecycle methods does useEffect with an empty dependency array approximate?
Does a parent re-render always force its children to re-render?
What does React.lazy do?
What is the purpose of Suspense?
What technique renders only the visible portion of a very long list?
What does the React Compiler (introduced around React 19) aim to do?
Which tool shows why a specific component re-rendered?
What is the risk of over-applying useMemo and useCallback?
What happens if useContext finds no matching Provider above it?
In React 19, how can a context be rendered as a provider?
Is Context a state management solution?
What is an Error Boundary?
Which errors do Error Boundaries NOT catch?
Can an Error Boundary be written as a function component?
What does ReactDOM.createPortal do?
Do events bubble through a portal according to the React tree or the DOM tree?
What is hydration?
What commonly causes a hydration mismatch?
What distinguishes a React Server Component from a Client Component?
What replaced ReactDOM.render in React 18?
In React Router v6, which component renders the first matching route?
Which React Router hook reads dynamic segments such as :id from the URL?
What does <Outlet /> do in React Router v6?
Why should you use <Link> instead of a plain <a> tag for internal navigation?
What is the core philosophy of React Testing Library?
What does the act() utility ensure in tests?
Which query should you prefer when selecting a button in React Testing Library?
What problem do server state libraries like TanStack Query address that useState does not?
What is the difference between client state and server state?
How do you associate a label with an input in JSX?
Why is a div with onClick worse than a button element?
What does useActionState return?
What did React 19 change about document metadata such as <title> and <meta>?
What happened to PropTypes and defaultProps for function components in React 19?
Which class lifecycle method is the correct place to fetch initial data?
What does shouldComponentUpdate control?
Why is super(props) called in a class component constructor?
What is the compound component pattern?
What is the container and presentational component split?
How can you reset a component's internal state when a prop changes?
Why is it recommended to keep state as flat as possible?