Back to results for “Effects & Lifecycle”
React › Strict Mode & Concurrent Features

What is React Strict Mode and what does it actually do?

Beginner

Answer

Strict Mode is a development only tool that helps find potential problems in your app early, before they cause real bugs. It does not render anything visible itself, but it intentionally runs certain functions twice during development, like component bodies and some effects, to help surface code that accidentally relies on something being run only once.
import { StrictMode } from 'react';

function App() {
  return (
    <StrictMode>
      <MainApp />
    </StrictMode>
  );
}
Real-world example A team wraps their entire app in Strict Mode during development, which helps them catch a bug where a component was accidentally causing a side effect directly during rendering, something that would have been much harder to notice otherwise.

Common follow-ups: Does Strict Mode have any effect on the app once it is built for production?;Why does Strict Mode intentionally run some code twice instead of just once?