Next.js · Middle · Question 72 of 75
With Cache Components, why does a form keep its typed text after navigating away and pressing Back?
- ✓Correct answer: Next.js hides previous routes with React
<Activity>instead of unmounting, preserving state and DOM - 2The browser restores form values from
localStorage - 3Next.js serializes component state into the URL
Explanation
Up to 3 routes are preserved. Transient UI like open dropdowns should be reset in an effect cleanup, or keyed by bfcacheId.