Interview frequency: …
Short answer
StrictMode helps developers detect deprecated practices and hidden problems; it renders components and reruns Effects twice in development.
Explanation
StrictMode adds nothing visible to the DOM. In development only, it runs render twice to detect impure functions, runs the setup and cleanup of useEffect twice to check for subscriptions and memory leaks, and warns about deprecated lifecycle methods or findDOMNode.
Code example
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
const root = createRoot(document.getElementById('root')!);
root.render(
<StrictMode>
<App />
</StrictMode>
);Common mistakes
- Treating a double useEffect call as a React bug and disabling StrictMode instead of writing proper cleanup logic.