Episode 2 — React Frontend Architecture NextJS / 2.9 — Custom Hooks and Reusable Logic
2.9.a — Why custom hooks exist: extracting shared logic
Learning outcomes
- State the problem custom hooks solve compared to plain functions or class patterns.
- Apply the Rules of Hooks to hooks you author.
- Decide when a custom hook beats a utility function or context.
The core idea
A custom hook is a JavaScript function whose name starts with use and that may call other hooks. It lets you reuse stateful logic across components without changing the component tree structure (unlike render props/HOCs for some cases).
import { useCallback, useState } from "react";
export function useCounter(initial = 0) {
const [count, setCount] = useState(initial);
const inc = useCallback(() => setCount((c) => c + 1), []);
return { count, inc };
}
Rules of Hooks (authoring perspective)
- Only call hooks at the top level of your custom hook (not inside loops/conditions unless those conditions never change hook order incorrectly—prefer avoiding).
- Only call hooks from React functions (components or custom hooks).
When not to create a hook
If logic is pure (no state, no effects), a plain calculateTotals(items) module is simpler.
Hooks vs context
Use context when many distant consumers need the same live value. Use a custom hook to bundle related state+actions that might still be created per subtree or passed as composition.
Appendix — Scenario bank (basic → advanced)
Flashcard: symptom → cause → fix → interview phrase.
CH0-001 — Why hooks #1
- Level: Beginner
- Symptom: duplicate
useEffectblocks across13screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-002 — Why hooks #2
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across26screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-003 — Why hooks #3
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across39screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-004 — Why hooks #4
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across52screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-005 — Why hooks #5
- Level: Advanced
- Symptom: duplicate
useEffectblocks across65screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-006 — Why hooks #6
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across78screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-007 — Why hooks #7
- Level: Beginner
- Symptom: duplicate
useEffectblocks across91screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-008 — Why hooks #8
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across104screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-009 — Why hooks #9
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across117screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-010 — Why hooks #10
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across130screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-011 — Why hooks #11
- Level: Advanced
- Symptom: duplicate
useEffectblocks across143screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-012 — Why hooks #12
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across156screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-013 — Why hooks #13
- Level: Beginner
- Symptom: duplicate
useEffectblocks across169screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-014 — Why hooks #14
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across182screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-015 — Why hooks #15
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across195screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-016 — Why hooks #16
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across8screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-017 — Why hooks #17
- Level: Advanced
- Symptom: duplicate
useEffectblocks across21screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-018 — Why hooks #18
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across34screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-019 — Why hooks #19
- Level: Beginner
- Symptom: duplicate
useEffectblocks across47screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-020 — Why hooks #20
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across60screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-021 — Why hooks #21
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across73screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-022 — Why hooks #22
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across86screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-023 — Why hooks #23
- Level: Advanced
- Symptom: duplicate
useEffectblocks across99screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-024 — Why hooks #24
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across112screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-025 — Why hooks #25
- Level: Beginner
- Symptom: duplicate
useEffectblocks across125screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-026 — Why hooks #26
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across138screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-027 — Why hooks #27
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across151screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-028 — Why hooks #28
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across164screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-029 — Why hooks #29
- Level: Advanced
- Symptom: duplicate
useEffectblocks across177screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-030 — Why hooks #30
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across190screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-031 — Why hooks #31
- Level: Beginner
- Symptom: duplicate
useEffectblocks across3screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-032 — Why hooks #32
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across16screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-033 — Why hooks #33
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across29screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-034 — Why hooks #34
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across42screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-035 — Why hooks #35
- Level: Advanced
- Symptom: duplicate
useEffectblocks across55screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-036 — Why hooks #36
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across68screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-037 — Why hooks #37
- Level: Beginner
- Symptom: duplicate
useEffectblocks across81screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-038 — Why hooks #38
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across94screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-039 — Why hooks #39
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across107screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-040 — Why hooks #40
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across120screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-041 — Why hooks #41
- Level: Advanced
- Symptom: duplicate
useEffectblocks across133screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-042 — Why hooks #42
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across146screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-043 — Why hooks #43
- Level: Beginner
- Symptom: duplicate
useEffectblocks across159screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-044 — Why hooks #44
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across172screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-045 — Why hooks #45
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across185screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-046 — Why hooks #46
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across198screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-047 — Why hooks #47
- Level: Advanced
- Symptom: duplicate
useEffectblocks across11screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-048 — Why hooks #48
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across24screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-049 — Why hooks #49
- Level: Beginner
- Symptom: duplicate
useEffectblocks across37screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-050 — Why hooks #50
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across50screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-051 — Why hooks #51
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across63screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-052 — Why hooks #52
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across76screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-053 — Why hooks #53
- Level: Advanced
- Symptom: duplicate
useEffectblocks across89screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-054 — Why hooks #54
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across102screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-055 — Why hooks #55
- Level: Beginner
- Symptom: duplicate
useEffectblocks across115screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-056 — Why hooks #56
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across128screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-057 — Why hooks #57
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across141screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-058 — Why hooks #58
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across154screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-059 — Why hooks #59
- Level: Advanced
- Symptom: duplicate
useEffectblocks across167screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-060 — Why hooks #60
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across180screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-061 — Why hooks #61
- Level: Beginner
- Symptom: duplicate
useEffectblocks across193screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-062 — Why hooks #62
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across6screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-063 — Why hooks #63
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across19screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-064 — Why hooks #64
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across32screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-065 — Why hooks #65
- Level: Advanced
- Symptom: duplicate
useEffectblocks across45screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-066 — Why hooks #66
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across58screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-067 — Why hooks #67
- Level: Beginner
- Symptom: duplicate
useEffectblocks across71screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-068 — Why hooks #68
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across84screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-069 — Why hooks #69
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across97screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-070 — Why hooks #70
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across110screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-071 — Why hooks #71
- Level: Advanced
- Symptom: duplicate
useEffectblocks across123screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-072 — Why hooks #72
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across136screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-073 — Why hooks #73
- Level: Beginner
- Symptom: duplicate
useEffectblocks across149screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-074 — Why hooks #74
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across162screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-075 — Why hooks #75
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across175screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-076 — Why hooks #76
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across188screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-077 — Why hooks #77
- Level: Advanced
- Symptom: duplicate
useEffectblocks across1screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-078 — Why hooks #78
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across14screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-079 — Why hooks #79
- Level: Beginner
- Symptom: duplicate
useEffectblocks across27screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-080 — Why hooks #80
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across40screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-081 — Why hooks #81
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across53screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-082 — Why hooks #82
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across66screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-083 — Why hooks #83
- Level: Advanced
- Symptom: duplicate
useEffectblocks across79screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-084 — Why hooks #84
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across92screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-085 — Why hooks #85
- Level: Beginner
- Symptom: duplicate
useEffectblocks across105screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-086 — Why hooks #86
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across118screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-087 — Why hooks #87
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across131screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-088 — Why hooks #88
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across144screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-089 — Why hooks #89
- Level: Advanced
- Symptom: duplicate
useEffectblocks across157screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-090 — Why hooks #90
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across170screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-091 — Why hooks #91
- Level: Beginner
- Symptom: duplicate
useEffectblocks across183screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-092 — Why hooks #92
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across196screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-093 — Why hooks #93
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across9screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-094 — Why hooks #94
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across22screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-095 — Why hooks #95
- Level: Advanced
- Symptom: duplicate
useEffectblocks across35screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-096 — Why hooks #96
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across48screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-097 — Why hooks #97
- Level: Beginner
- Symptom: duplicate
useEffectblocks across61screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-098 — Why hooks #98
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across74screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-099 — Why hooks #99
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across87screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-100 — Why hooks #100
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across100screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-101 — Why hooks #101
- Level: Advanced
- Symptom: duplicate
useEffectblocks across113screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-102 — Why hooks #102
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across126screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-103 — Why hooks #103
- Level: Beginner
- Symptom: duplicate
useEffectblocks across139screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-104 — Why hooks #104
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across152screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-105 — Why hooks #105
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across165screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-106 — Why hooks #106
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across178screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-107 — Why hooks #107
- Level: Advanced
- Symptom: duplicate
useEffectblocks across191screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-108 — Why hooks #108
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across4screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-109 — Why hooks #109
- Level: Beginner
- Symptom: duplicate
useEffectblocks across17screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-110 — Why hooks #110
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across30screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-111 — Why hooks #111
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across43screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-112 — Why hooks #112
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across56screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-113 — Why hooks #113
- Level: Advanced
- Symptom: duplicate
useEffectblocks across69screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-114 — Why hooks #114
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across82screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-115 — Why hooks #115
- Level: Beginner
- Symptom: duplicate
useEffectblocks across95screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-116 — Why hooks #116
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across108screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-117 — Why hooks #117
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across121screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-118 — Why hooks #118
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across134screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-119 — Why hooks #119
- Level: Advanced
- Symptom: duplicate
useEffectblocks across147screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-120 — Why hooks #120
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across160screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-121 — Why hooks #121
- Level: Beginner
- Symptom: duplicate
useEffectblocks across173screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-122 — Why hooks #122
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across186screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-123 — Why hooks #123
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across199screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-124 — Why hooks #124
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across12screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-125 — Why hooks #125
- Level: Advanced
- Symptom: duplicate
useEffectblocks across25screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-126 — Why hooks #126
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across38screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-127 — Why hooks #127
- Level: Beginner
- Symptom: duplicate
useEffectblocks across51screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-128 — Why hooks #128
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across64screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-129 — Why hooks #129
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across77screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-130 — Why hooks #130
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across90screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-131 — Why hooks #131
- Level: Advanced
- Symptom: duplicate
useEffectblocks across103screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-132 — Why hooks #132
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across116screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-133 — Why hooks #133
- Level: Beginner
- Symptom: duplicate
useEffectblocks across129screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-134 — Why hooks #134
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across142screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-135 — Why hooks #135
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across155screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-136 — Why hooks #136
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across168screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-137 — Why hooks #137
- Level: Advanced
- Symptom: duplicate
useEffectblocks across181screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-138 — Why hooks #138
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across194screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-139 — Why hooks #139
- Level: Beginner
- Symptom: duplicate
useEffectblocks across7screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-140 — Why hooks #140
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across20screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-141 — Why hooks #141
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across33screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-142 — Why hooks #142
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across46screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-143 — Why hooks #143
- Level: Advanced
- Symptom: duplicate
useEffectblocks across59screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-144 — Why hooks #144
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across72screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-145 — Why hooks #145
- Level: Beginner
- Symptom: duplicate
useEffectblocks across85screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-146 — Why hooks #146
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across98screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-147 — Why hooks #147
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across111screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-148 — Why hooks #148
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across124screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-149 — Why hooks #149
- Level: Advanced
- Symptom: duplicate
useEffectblocks across137screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-150 — Why hooks #150
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across150screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-151 — Why hooks #151
- Level: Beginner
- Symptom: duplicate
useEffectblocks across163screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-152 — Why hooks #152
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across176screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-153 — Why hooks #153
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across189screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-154 — Why hooks #154
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across2screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-155 — Why hooks #155
- Level: Advanced
- Symptom: duplicate
useEffectblocks across15screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-156 — Why hooks #156
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across28screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-157 — Why hooks #157
- Level: Beginner
- Symptom: duplicate
useEffectblocks across41screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-158 — Why hooks #158
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across54screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-159 — Why hooks #159
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across67screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-160 — Why hooks #160
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across80screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-161 — Why hooks #161
- Level: Advanced
- Symptom: duplicate
useEffectblocks across93screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Two hooks mutate same global module variable (hidden coupling).
- Primary remediation: Add light RFC for shared hooks folder conventions.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-162 — Why hooks #162
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across106screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Conditional hook call inside custom hook helper function.
- Primary remediation: Version return object with documented fields; prefer small objects over huge bags.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-163 — Why hooks #163
- Level: Beginner
- Symptom: duplicate
useEffectblocks across119screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Team invents hook for every 5 lines without design discussion.
- Primary remediation: Pass dependencies explicitly; avoid module singletons for feature state.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-164 — Why hooks #164
- Level: Beginner+
- Symptom: duplicate
useEffectblocks across132screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook used only once—premature abstraction.
- Primary remediation: Wait for second usage or extract pure function instead.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-165 — Why hooks #165
- Level: Intermediate
- Symptom: duplicate
useEffectblocks across145screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: God hook returns 40 unrelated fields used by one screen each.
- Primary remediation: Extract shared
useAbortableor document cleanup contract. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-166 — Why hooks #166
- Level: Intermediate+
- Symptom: duplicate
useEffectblocks across158screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Hook API unstable: return shape changes every PR breaking consumers.
- Primary remediation: Refactor to unconditional hook paths; lift condition to caller.
- Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-167 — Why hooks #167
- Level: Advanced
- Symptom: duplicate
useEffectblocks across171screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Copy-paste hook without extracting shared cleanup (memory leak).
- Primary remediation: Split into
useInvoiceList+useInvoiceActionswith cohesive return types. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.
CH0-168 — Why hooks #168
- Level: Advanced+
- Symptom: duplicate
useEffectblocks across184screens or flaky tests after hook refactor. - Maintainability smell: hook name does not match behavior; grep fails.
- Root cause class: Custom hook is just a function without
useprefix but calls hooks—confusing and breaks lint rules. - Primary remediation: Name hooks
useThing; only call hooks at top level of hook or component. - Verify: RTL hook test + one story + bundle diff if heavy.
- Interview one-liner: Custom hooks exist to reuse stateful logic while obeying the Rules of Hooks—composition without wrapper components.