component lifecycle
The stages every component instance goes through: it mounts, updates zero or more times as it re-renders, and finally unmounts.
In more detail
Effects are best thought of from their own point of view instead: each one starts synchronising and later stops, possibly many times during one component lifecycle. Hooks let a function component respond to each stage without separate lifecycle methods.
Related terms
- mount — When React creates a component for the first time and adds its DOM nodes to the page.
- unmount — When React removes a component and its DOM nodes from the page, discarding its state.
- useEffect — The React hook for running side work, such as adding listeners or changing document.body, after a component renders.
- lifecycle method — A method of a class component that React calls at a particular moment, such as after mounting, after an update or after an error.
Taught in
- Component Purity: Pure Functions, Idempotence And Side Effects — React 19 & Modern Component Architecture
- Keys In Depth: Identity Preservation And Identity Resetting — React 19 & Modern Component Architecture
- Diffing Algorithm: Element Type Shifts And Subtree Tear Down — React 19 & Modern Component Architecture
- SyntheticEvent System: Event Delegation in Modern React — React 19 & Modern Component Architecture
- useEffect Lifecycle: Mount, Dependencies, And Cleanup Phases — React 19 & Modern Component Architecture
- useLayoutEffect vs useEffect: Painting And Synchronous Reads — React 19 & Modern Component Architecture
- useRef Mechanics: DOM References And Mutable Persistent State — React 19 & Modern Component Architecture
- Creating Event Listener Hooks with Clean Teardown Logic — React 19 & Modern Component Architecture
- useActionState: Async Action Handlers And Pending States — React 19 & Modern Component Architecture
- useOptimistic: Instantaneous UI Updates with Rollback — React 19 & Modern Component Architecture