02 / 05

What happens once you wrap your app in strict mode?

<StrictMode> lets you find common bugs in your components early during development process. Although the Strict Mode checks only run in development, they help you find bugs that already exist in your code but can be tricky to reliably reproduce in production. Strict Mode lets you fix bugs before your users report them.

Strict Mode enables the following checks in development:
  1. 1

    Your components will re-render an extra time to find bugs caused by impure rendering.

  2. 2

    Your components will re-run Effects an extra time to find bugs caused by missing Effect cleanup.

  3. 3

    Your components will be checked for usage of deprecated APIs.

Difficulty: 5/10
Topics: strict mode, lifecycle warnings, dev tooling

Scenario Questions

0-2 years experience
  1. 1

    If you wrap your root component in <React.StrictMode>, what immediate changes do you notice when you run the app locally?

  2. 2

    How would you check that a useEffect cleanup runs correctly after enabling StrictMode?

  3. 3

    What happens to console warnings for deprecated lifecycle methods when StrictMode is turned on?

2-5 years experience
  1. 1

    You added StrictMode to a feature branch and a third‑party UI library now throws errors about unsafe lifecycles. How would you approach fixing this?

  2. 2

    After enabling StrictMode, a component renders twice and triggers duplicate API calls. Walk me through how you'd debug and resolve the issue.

  3. 3

    Explain why a form component might lose state updates under StrictMode and how you'd adjust the code to prevent it.

5-8 years experience
  1. 1

    Our monorepo is being migrated to StrictMode incrementally. What rollout strategy would you use to avoid breaking production, and how would you measure success?

  2. 2

    StrictMode runs certain checks only in development. How would you ensure similar safety guarantees are enforced in production builds?

  3. 3

    Discuss the performance impact of StrictMode's double rendering during development and how you would mitigate developer friction.

8+ years experience
  1. 1

    As a staff engineer, you need to get multiple teams to adopt StrictMode across a codebase with legacy class components and many external packages. What migration plan and governance model would you propose?

  2. 2

    If a critical third‑party library cannot be upgraded to support StrictMode, how would you balance technical debt, release timelines, and team velocity?

  3. 3

    How would you design tooling or CI checks to enforce that new code complies with StrictMode constraints organization‑wide?

Follow-up Questions

  • Can you show an example of a warning you saw after enabling StrictMode?
  • What would you do if a third‑party library fails under StrictMode?
  • How do you verify that your fix actually resolves the StrictMode issue?