RE

rerender-memo

Optimize React components by memoizing expensive logic and calculations.

Install

mkdir -p .claude/skills/rerender-memo && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2361" && unzip -o skill.zip -d .claude/skills/rerender-memo && rm skill.zip

Installs to .claude/skills/rerender-memo

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Extract expensive work into memoized components with React.memo. Apply when components perform expensive computations that can be skipped when props haven't changed.
165 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Identifies computationally expensive logic in React components
  • Wraps sub-components in React.memo
  • Implements useMemo hooks for specific data chunks
  • Refactors heavy rendering tasks to child components
  • Skips re-renders when props are stable

How it works

Separates heavy operations into memoized child components, allowing React to bypass the parent component's re-render logic.

Inputs & outputs

You give it
React component with expensive calculation logic
You get back
Refactored code with memoized sub-components

When to use rerender-memo

  • Optimize component re-renders
  • Memoize expensive calculations
  • Refactor heavy rendering logic

About this skill

Extract to Memoized Components

Extract expensive work into memoized components to enable early returns before computation.

Incorrect (computes avatar even when loading):

function Profile({ user, loading }: Props) {
  const avatar = useMemo(() => {
    const id = computeAvatarId(user)
    return <Avatar id={id} />
  }, [user])

  if (loading) return <Skeleton />
  return <div>{avatar}</div>
}

Correct (skips computation when loading):

const UserAvatar = memo(function UserAvatar({ user }: { user: User }) {
  const id = useMemo(() => computeAvatarId(user), [user])
  return <Avatar id={id} />
})

function Profile({ user, loading }: Props) {
  if (loading) return <Skeleton />
  return (
    <div>
      <UserAvatar user={user} />
    </div>
  )
}

Note: If your project has React Compiler enabled, manual memoization with memo() and useMemo() is not necessary. The compiler automatically optimizes re-renders.

When not to use it

  • Projects already using React Compiler
  • Micro-optimizing components that are already fast
  • Complex components where state management depends on constant re-evaluation

Prerequisites

react

Limitations

  • Does not optimize logic if props change constantly
  • Manual refactoring requires developer review

How it compares

It focuses on structural refactoring to enable early return patterns rather than just applying generic memoization.

Compared to similar skills

rerender-memo side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
rerender-memo (this skill)16moNo flagsIntermediate
react-best-practices223moNo flagsIntermediate
react-component-performance24moNo flagsAdvanced
epic-react-patterns16moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry