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

More React tasks

Back to the full React Components & JSX cheat sheet