rerender-memo

Extract to Memoized Components

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rerender-memo" with this command: npx skills add theorcdev/8bitcn-ui/theorcdev-8bitcn-ui-rerender-memo

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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

fumadocs-mdx-structure

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

rendering-animate-svg

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

8-bit-pixel-art-patterns

No summary provided by upstream source.

Repository SourceNeeds Review