React best-practices reviewer for TSX files. Triggers after editing multiple TSX components to run a condensed quality checklist covering component structure, hooks usage, accessibility, performance, and TypeScript patterns.
After editing several TSX/JSX files, run through this condensed checklist to catch common issues before they compound.
types.ts unless sharedfunction Card({ title, children }: CardProps)index.ts re-exports) in large projects — they hurt tree-shakinguse*react-hooks/exhaustive-depsuseCallback / useMemo — use only when passing to memoized children or expensive computations, not by defaultuseEffect cleanup — return a cleanup function for subscriptions, timers, and abort controllersuseEffect to mirror state<button>, <a>, <nav>, <main>, etc. before reaching for <div onClick>alt on every <img> — decorative images get alt=""aria-* attributes — only when native semantics are insufficient; don't redundantly labelReact.memo — wrap pure display components that re-render due to parent changesReact.lazy + Suspense for route-level code splittingnext/image or responsive srcSet; avoid unoptimized <img> in Next.jsReact.FC is optional — prefer plain function declarations with explicit return typesPropsWithChildren — use when the component accepts children but has no other custom propsReact.MouseEvent<HTMLButtonElement>, not anyfunction List<T>({ items, renderItem }: ListProps<T>)as const for config objects — ensures literal types for discriminated unions and enumsdiv rounded-xl border p-6 blocks usually mean stronger composition primitives are missing.