CodeZettaInterview Hub

React · Reconciliation · Senior · Code Output

What happens when a component type changes at the same position?

Short Interview Answer

React tears down the old tree and mounts a new one—state resets.

Detailed Explanation

Conditional swapping of component types remounts. Use keys intentionally to force reset when needed.

Did you know this answer?