using-keys

Enforce identity-based keys for ReactUMG components to prevent re-renders.

1|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/15195999826/LomoMarketplace --skill using-keys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-keys
Source: https://github.com/15195999826/LomoMarketplace/tree/main/plugins/UE_ReactUMG/skills/using-keys/SKILL.md
Command: npx skills add https://github.com/15195999826/LomoMarketplace --skill using-keys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keys identify component identity, not state. This skill emphasizes stable keys to ensure efficient reconciliation and avoid unnecessary re-renders.

Core Features & Use Cases

  • Identity-based keys: use item.id or stable identifiers rather than coordinates.
  • Performance focus: avoid changing keys during animation frames or position updates.
  • Best practices: separate identity from positional data.

Quick Start

Use a stable key like item.id for list items; update Slot props to reflect position without changing keys.

Frequently Asked Questions about using-keys

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do React lists need stable keys instead of array indices?

Stable keys identify components by their data identity, not position. Using indices causes React to re-render and lose component state when list order changes, degrading performance and causing unnecessary churn during animations or drag operations.

How do I prevent performance problems when rendering dynamic lists in ReactUMG?

Use stable identifiers like item.id as keys rather than coordinates or array positions. This ensures React reconciliation preserves component identity across updates, preventing re-renders when positions change while data remains the same.

What's the difference between using coordinates and item IDs as React keys?

Coordinate or index-based keys change when component position updates, forcing React to treat them as new components and lose internal state. Identity-based keys like item.id remain constant, allowing React to preserve component state and optimize re-renders efficiently.

Can I use changing indices as keys during drag previews or animation updates?

No. Changing keys during position updates breaks component identity tracking, causing performance degradation and state loss. Keep keys stable based on data identity; update Slot props to reflect new positions without changing the key itself.

How do I separate component identity from positional data in ReactUMG rendering?

Assign keys from stable data properties (item.id), then pass position or coordinate information through Slot props instead. This preserves component identity across position changes and enables efficient reconciliation aligned with React's update semantics.