react-key-prop
React: Key Prop Best Practices
Core Principle
Use stable, unique IDs from your data. Never use array index for dynamic lists.
The key prop provides stable identity to list elements during React's reconciliation process.
When to Use What
Use Data IDs (Preferred)
Always use unique, stable identifiers directly from your data:
// ✅ Correct
{todos.map((todo) => (
<li key={todo.id}>{todo.text}</li>
))}
More from flpbalada/fb-skills
progressive-disclosure
Reduce complexity by revealing information progressively. Use when designing
10discuss-task
Clarify ambiguous tasks before action. Use when goal, scope, success criteria, constraints, or risks are unclear.
7react-useeffect-avoid
Guides when NOT to use useEffect and suggests better alternatives. Use when reviewing React code, troubleshooting performance, or considering useEffect for derived state or form resets.
6discuss-code
Critically discuss code issues with compact findings. Use when code needs review for logic, simplicity, structure, naming, or maintainability.
6cognitive-fluency-psychology
Apply cognitive fluency principles to improve clarity, trust, and conversion.
5typescript-satisfies-operator
Guides proper usage of TypeScript's satisfies operator vs type annotations. Use this skill when deciding between type annotations (colon) and satisfies, validating object shapes while preserving literal types, or troubleshooting type inference issues.
5