StrictMode in React
From the React Components & JSX cheat sheet ยท Optimization & Advanced Features ยท verified Jul 2026
StrictMode
Catch bugs early by enabling extra development checks
jsx
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>
);๐ก StrictMode runs in dev only โ no production impact, no perf cost
โก Double-rendering surfaces impure components and missing cleanup early
๐ If your console.log fires twice in dev, that's StrictMode catching a side effect
๐ข You can wrap individual subtrees in StrictMode for gradual adoption
strict-modedevdebugging