React·Advanced·Conceptual·1 min read
Why can defining a component inside another component reset state?
Short interview answer
A new component function identity is created on every outer render, so React sees a different element type and remounts the nested subtree.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.