/harness-claude:react-memoization-patternfrom harness-claude
Guides applying React memoization APIs (React.memo, useMemo, useCallback) to prevent expensive re-renders, with profiling-first advice and React 19 compiler considerations.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:react-memoization-pattern still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Prevent expensive re-renders and recomputations with React memoization APIs
React.memo)useMemo)React.memo on child components (use useCallback)React.memo to skip re-render when props are shallowly equal:
const ExpensiveList = React.memo(function ExpensiveList({ items }: { items: Item[] }) {
return <ul>{items.map((i) => <li key={i.id}>{i.name}</li>)}</ul>;
});
useMemo for expensive computations:
const sortedItems = useMemo(() => [...items].sort(compareFn), [items]);
useCallback for stable callback references:
const handleClick = useCallback(() => onSelect(id), [id, onSelect]);
React.memo/useMemo until you verify the compiler does not handle it.Memoization trades memory for computation. React's memoization hooks cache values between renders when dependency arrays are unchanged.
Shallow equality: React.memo uses shallow comparison — object/array props created inline always produce new references, breaking memoization. Pass stable references or memoize the props themselves.
useMemo vs useCallback:
useMemo memoizes a computed value: useMemo(() => compute(), [dep])useCallback memoizes a function: useCallback(() => fn(), [dep]) — equivalent to useMemo(() => () => fn(), [dep])React 19 Compiler: The React compiler automatically memoizes components and hooks. Manual React.memo, useMemo, and useCallback may become unnecessary in codebases using the compiler.
Anti-pattern: Wrapping every component in React.memo without profiling. Memo has overhead — the cost of comparison must be less than the cost of re-rendering.
https://patterns.dev/react/memoization-pattern
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job