Strict Mode
A development-only React wrapper that runs extra checks, such as rendering components twice and running every Effect setup and cleanup an extra time.
In more detail
The doubled calls expose impure rendering, missing cleanup functions and leaked subscriptions early. Strict Mode has no effect on production builds.
Example
<StrictMode><App /></StrictMode>Related terms
- pure function — A function whose result depends only on its arguments and which has no side effects, so the same inputs always give the same output.
- cleanup function — The function an Effect returns so React can undo what the setup did, such as removing a listener or cancelling a request.
- development build — The version of React used while writing code, which adds warnings and checks that are removed from the smaller, faster production build.
Taught in
- Component Purity: Pure Functions, Idempotence And Side Effects — React 19 & Modern Component Architecture
- useEffect Lifecycle: Mount, Dependencies, And Cleanup Phases — React 19 & Modern Component Architecture
- Avoiding Effect Antipatterns: Derived State And Events — React 19 & Modern Component Architecture
- Creating Event Listener Hooks with Clean Teardown Logic — React 19 & Modern Component Architecture