Strict Mode
Question
What does React.StrictMode do?
Hint
StrictMode double-invokes some functions in dev to find bugs.
Explanation
React.StrictMode is a wrapper that enables additional development-only checks and warnings. It does not affect production builds. In dev, it intentionally double-invokes: component render, useState/useReducer initializers, useMemo/useCallback, and effects (mount, unmount, remount) to surface bugs from impure renders or missing cleanups. It also warns about deprecated APIs, string refs, and legacy context. Wrap your app: <StrictMode><App /></StrictMode>. The double-invocation is dev-only and has no production impact.
Related Resources
Related Lessons
- Best Practices
Learn best practices.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.