- 01
What causes a React component to render again?
A component renders when its state changes, its parent renders, or consumed context changes. React may skip committed DOM changes when output is equivalent, but render functions should still remain pure.
- 02
When should state be lifted up?
Lift state to the nearest common owner when multiple components need the same source of truth or coordinated updates. Avoid moving state higher than necessary because broad ownership increases coupling and render scope.
- 03Latest question
What is useEffect intended for?
Question codetsxfunction Profile({ firstName, lastName }) { const [fullName, setFullName] = useState('') useEffect(() => { setFullName(`${firstName} ${lastName}`) }, [firstName, lastName]) }useEffect synchronizes a component with an external system such as a subscription, timer, browser API, or network lifecycle. It should not be the default place for values that can be calculated during rendering.
Answer codetsxfunction Profile({ firstName, lastName }) { const fullName = `${firstName} ${lastName}` return <h2>{fullName}</h2> } - 04
Why are stable keys important when rendering lists?
Keys let React preserve the identity of items between renders. Unstable keys can cause incorrect state reuse, lost input state, or unnecessary component replacement when items are inserted or reordered.
- 05
How should React performance problems be approached?
Use the React Profiler and browser tools to find expensive renders or interactions first. Then narrow state, reduce unnecessary work, virtualize large collections, or memoize only where measurement shows value.
- 06
What makes a reusable React component accessible?
Start with semantic HTML, preserve keyboard behavior and focus, expose names and states to assistive technology, and test real interactions. ARIA supplements missing semantics but should not replace native elements.
JavaScript Frameworks
React Interview Questions and Answers
Review React interview questions on component design, state, effects, rendering, hooks, accessibility, testing, and performance.
Continue preparing
Related interview guides
Need delivery capability?
