remount
Removing a component from the page and creating it again from scratch, which resets its state and re-runs its effects.
In more detail
Layouts are not remounted when you navigate within them; templates are. Changing a component's key also forces React to remount it.
Related terms
- template.tsx — A special file like layout.tsx that wraps its children but is created fresh on every navigation, so its state resets.
- useEffect — The React hook for running side work, such as adding listeners or changing document.body, after a component renders.
- useState — The React hook that adds a state variable to a component and returns the current value with a function to change it.
Taught in
- Root & Nested Layouts: State Preservation Semantics — Next.js 15 & Modern App Router Architecture
- Templates vs Layouts: Remounting & Page Transitions — Next.js 15 & Modern App Router Architecture
- Async Data Fetching: Parallel Requests & Preloading — Next.js 15 & Modern App Router Architecture