Interview Q&A / React

INTERVIEW Q&A · 58 QUESTIONS

React interview questions

Rendering, state, hooks, keys and effects, explained with small examples.

  1. What does React.StrictMode do?

    StrictMode is a development-only wrapper that helps find bugs. It renders components twice, re-runs effects once after mount and warns about deprecated APIs. It has no effect and no cost in production builds.

    BeginnerQuick answer1 min read
  2. Why does my useEffect run twice in development?

    In Strict Mode, React 18 and later deliberately mounts, unmounts and remounts each component once in development to check that effects clean up properly. It does not happen in production.

    BeginnerQuick answer1 min read