Strict Mode
In one line
Strict Mode is a development-only wrapper component that intentionally double-invokes certain functions to surface hidden bugs.
In simple words
<React.StrictMode> is a wrapper that enables extra checks and warnings in development. It does nothing in production — it is stripped out. Its purpose is to help you find problems early.
In Strict Mode, React intentionally double-invokes: component render functions, the useState initializer, the useMemo and useReducer initializers, and useEffect setup/cleanup. This surfaces bugs in code that assumes functions run exactly once — impure renders, effects that don't clean up properly, etc.
Strict Mode also warns about deprecated APIs, unsafe lifecycles, and legacy ref APIs. You should wrap your entire app in Strict Mode during development. The double-invocation is safe if your components are pure and your effects have proper cleanup — which they should be anyway.
Example
import { StrictMode } from "react";
function App() {
return (
<StrictMode>
<Root />
</StrictMode>
);
}Wrapping the app in StrictMode enables extra development checks. It has no effect in production builds.
Related terms
Related Resources
Related Lessons
- React Best Practices
Learn Strict Mode and development best practices.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.