# list-performance-callbacks

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

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 88 repo stars
- Author: alexj11324
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/alexj11324/Mikka/tree/HEAD/.claude/skills/react-native-skills/rules/list-performance-callbacks.md
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/list-performance-callbacks

## What it 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.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/list-performance-callbacks.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/list-performance-callbacks.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/list-performance-callbacks.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/list-performance-callbacks.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/list-performance-callbacks.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/alexj11324/Mikka/tree/HEAD/.claude/skills/react-native-skills/rules/list-performance-callbacks.md

## When to use it
- 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
- 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.

## Similar
- [list-performance-item-types](https://affpapa.org/en/nevibecode/rules/list-performance-item-types.md) — rule · ★ 1216 repo stars
- [list-performance-function-references](https://affpapa.org/en/nevibecode/rules/list-performance-function-references.md) — rule · ★ 1216 repo stars
- [_template](https://affpapa.org/en/nevibecode/rules/template.md) — rule · ★ 1064 repo stars
- [legend-list-best-practices](https://affpapa.org/en/nevibecode/skills/legend-list-best-practices.md) — skill · 562 installs
- [phone_list_apps](https://affpapa.org/en/nevibecode/prompts/phone-list-apps.md) — prompt · ★ 9488 repo stars
- [list-connections](https://affpapa.org/en/nevibecode/skills/list-connections.md) — skill · ★ 1167 repo stars

From the same set: [alexj11324/mikka](https://affpapa.org/en/nevibecode/by/alexj11324/mikka.md) — 47 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
