Skip to main content
rule CX Codex

list-performance-callbacks — Claude Code rule for lists

list-performance-callbacks is a Claude Code rule for passing event handlers to list items. It applies when callbacks are used inside a list.

AGPL-3.0 ★ 88 updated 2026-11-17

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/list-performance-callbacks.md
Open on GitHub

What list-performance-callbacks does

The rule places one handler at the list level and passes it to the items, which provide their own identifiers when calling it. This avoids creating a separate function inside renderItem on each render.

Its example uses useCallback. The guidance covers callbacks passed to list-item components; it does not describe a broader application-wide performance setup.

What it helps with

  • pass an event handler to list items
  • avoid creating a callback inside renderItem on every render
  • use one handler with different item identifiers

Example prompts for the agent

  • Apply list-performance-callbacks to the handlers for this list.
  • Check where the callback for list items is created in renderItem.
  • Refactor the list handlers to follow list-performance-callbacks.

How to install list-performance-callbacks

Manually: put the files in place

.claude/rules/list-performance-callbacks.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about list-performance-callbacks

How do I install list-performance-callbacks in Claude Code?

Add the rule file at .claude/rules/list-performance-callbacks.md.

What does list-performance-callbacks do?

It advises creating a handler at the list level and passing it to items, which call it with their identifiers.

How does list-performance-callbacks apply to renderItem?

It advises against creating a callback inside renderItem on every render and instead passes the items one handler.

Similar IDE rules

All IDE rules for Mobile →

From the same set47

The whole set →
design-deslop design-deslop is a Claude Code command that strips machine-generated visual tells from UI. It runs against new branch diffs before frontend changes get merged. CX Codex +1 ★ 88repo stars design-review design-review is a Claude Code command that reviews a UI build for visual hierarchy and craft. It rates findings by severity and returns a verdict. CX Codex +1 ★ 88repo stars rendering-text-in-text-component rendering-text-in-text-component is a Claude Code rule that enforces wrapping strings in React Native Text elements. It prevents runtime crashes in mobile interfaces. CX Codex +1 ★ 88repo stars monorepo-native-deps-in-app monorepo-native-deps-in-app is a Claude Code rule that enforces adding native packages directly to the mobile app manifest. It prevents build failures caused by missed autolinking in monorepos. CX Codex +1 ★ 88repo stars react-compiler-reanimated-shared-values react-compiler-reanimated-shared-values is a Claude Code rule for handling Reanimated shared values with React Compiler enabled. It directs code to use .get() and .set() rather than .value. CX Codex +1 ★ 88repo stars react-compiler-destructure-functions react-compiler-destructure-functions is a Claude Code rule that enforces extracting hook functions early in render scope. It targets projects running the React Compiler. CX Codex +1 ★ 88repo stars ui-scrollview-content-inset ui-scrollview-content-inset is a Claude Code rule for changing ScrollView spacing when keyboards, toolbars, or content alter the available space. CX Codex +1 ★ 88repo stars monorepo-single-dependency-versions monorepo-single-dependency-versions is a Claude Code rule that pins identical dependency versions across monorepo packages. It stops bundle bloat and runtime version clashes. CX Codex +1 ★ 88repo stars

Project sponsors

Companies that keep this analytics open