React Rendering & Performance Interview Questions 2026
- Authors

- Name
- Geeks Kai
- @KaiGeeks

These eight React performance questions distinguish a component render, a DOM commit and measured browser work. The memo and lazy-loading examples explain what to verify before making a performance claim, including updates from state and Context.
Version scope: React 19.3.0, with manual memoization examples and no React Compiler transform assumed. Local DOM fixtures check behavior, not real-browser paint timing, bundle size, or a guaranteed performance gain. Complete modules are labeled by filename.
React elements describe the intended UI. During render, React calls components to calculate that description; during commit, it applies the resulting host changes, such as DOM updates. Calling a component is different from changing the DOM.
"Virtual DOM" is useful shorthand for this representation and comparison process, not a guarantee of globally minimal mutations or of being faster than every direct DOM implementation. Performance depends on the actual workload and what the browser must lay out, paint, and execute.
Reconciliation matches the next rendered tree to the previous tree. Element type, position, and keys help React decide which component instances and state to preserve. A changed type or key can intentionally reset state.
React can render components while leaving unchanged DOM nodes intact during commit. Do not use "reconciliation" to mean that components never rerender, or promise a globally optimal diff. Use stable keys from records when items can move, and verify the resulting state and DOM behavior.
React.memo help improve performance?memo lets React skip some parent-driven work when props compare equal. By default, it compares each prop with Object.is; a newly created object or function is a different reference. A custom comparator must cover every prop that affects output or behavior.
It remains a performance optimization, not a promise that the component will never render. The child's own state and consumed Context can still update it. This complete example keeps a stable label while exposing both of those update paths:
// file: memo-example.jsx
import { createContext, memo, useContext, useState } from "react"
export const ThemeContext = createContext("light")
export const MemoChild = memo(function MemoChild({ label }) {
const theme = useContext(ThemeContext)
const [count, setCount] = useState(0)
return (
<button onClick={() => setCount(previousCount => previousCount + 1)}>
{label}: {theme}: {count}
</button>
)
})
export function MemoExample() {
const [parentCount, setParentCount] = useState(0)
const [theme, setTheme] = useState("light")
function toggleTheme() {
setTheme(previousTheme => previousTheme === "light" ? "dark" : "light")
}
return (
<ThemeContext.Provider value={theme}>
<button onClick={() => setParentCount(previousCount => previousCount + 1)}>Update parent</button>
<output>Parent: {parentCount}</output>
<button onClick={toggleTheme}>Toggle theme</button>
<MemoChild label="Child" />
</ThemeContext.Provider>
)
}
Updating the parent does not change the child label. Clicking Child changes its own state, and Toggle theme changes its Context. Confirm those visible results; do not turn a particular development render count into a universal performance guarantee.
Start with a reproducible slow interaction, representative inputs, and a measurement. Use React DevTools profiling for component commits and browser performance tools for scripting, layout, paint, and network work. Compare the same interaction after one targeted change.
An inline callback is not automatically a performance bug. Wrapping every function in useCallback adds complexity without ensuring a benefit. React Compiler can change the need for manual caching when enabled; performance conclusions still need the chosen application and build configuration.
Code splitting lets a bundler create separately loadable code. lazy loads a component definition on demand, and Suspense shows a fallback while it is pending. The imported module must resolve with a default component; a named export can be adapted deliberately.
Save these two complete modules together in a React project that supports dynamic imports:
// file: lazy-app.jsx
import { lazy, Suspense } from "react"
const LazyPanel = lazy(() => import("./LazyPanel"))
export default function LazyApp() {
return (
<Suspense fallback={<p>Loading panel...</p>}>
<LazyPanel />
</Suspense>
)
}
// file: LazyPanel.jsx
export default function LazyPanel() {
return <p>Panel ready</p>
}
Suspense handles the pending load, not every rejected request or arbitrary Promise created in an Effect. A failed module load needs an Error Boundary or framework error handling. A DOM fixture can verify fallback and resolved content; inspect the real bundler output and network requests before claiming smaller initial downloads or faster loading.
Component and PureComponent both support class components. Component has no default shallow props/state comparison, although shouldComponentUpdate and other React behavior can affect whether work proceeds. It is inaccurate to promise that every setState call always produces a render and a DOM change.
PureComponent supplies a shallow props/state comparison. Mutating an existing object can therefore hide a change; update objects immutably. A consumed Context can still update a consumer. For new function components, memo is the related optimization tool, with its own state/Context and comparison boundaries.
A state setter requests an update; it does not change the state snapshot already captured by the current render. React may skip work when the next state compares equal with Object.is. Normal parent rendering can also call a child even when its props look unchanged, unless an applicable optimization skips that work.
When React renders, it calculates the next UI. Commit then applies the required host changes. Neither "a component rendered" nor "a state setter was called" proves that the browser changed every DOM node. Use immutable updates and functional updaters when the next state depends on previous state.
useMemo caches a calculation result; useCallback caches the function reference React returns. Both compare their declared dependencies with Object.is, and both require complete reactive inputs. useCallback does not stop the function expression itself from being created.
These caches are optimizations that React may discard. They do not establish durable storage, make impure code correct, or directly prevent all child rendering. Start with correct code, measure the expensive path, and then choose the smallest useful optimization.
Continue your React JS interview questions preparation with these related topics:
Master Core React interview questions covering JSX, Virtual DOM, Components, Props, State, and more. Essential React JS ...
Comprehensive React Hooks interview questions covering useState, useEffect, useCallback, useMemo, useReducer, and custom...
Master React State Management interview questions covering useState, Context API, Redux, and state optimization. Essenti...
Master all aspects of React development
This article is part of our comprehensive React JS interview questions series covering all aspects of React development. Explore all topics: