Scope: Migrating class components to function components with hooks. All mappings sourced from CockroachDB's production codebase migration skill. Does NOT cover general hook patterns (SKILL.md) or performance optimization (Performance.md).
this.state = { ... }→ individualuseStatehooks — one hook per logical piece of state, not one object. [source: cockroachdb/cockroach]componentDidMount→useEffect(fn, [])— empty deps array runs once after first render. [source: cockroachdb/cockroach]componentDidUpdate(prevProps, prevState)→useEffect(fn, [deps])— list the specific values that should trigger the effect. [source: cockroachdb/cockroach]componentWillUnmount→ cleanup return fromuseEffect— return a function; React calls it on unmount. [source: cockroachdb/cockroach]