event-delegation
CommunityCentralize React event handling for scalable UI.
Authortrae-op
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Event delegation reduces prop drilling and the need to attach handlers to every child by placing a single listener on a parent container, using event.target to identify the source component.
Core Features & Use Cases
- Single parent event listener that handles actions for many child elements.
- Reduces prop drilling across deeply nested components and improves performance.
- Ideal for dynamic lists/grids where items are created or removed at runtime and each item supports actions via data attributes.
Quick Start
Attach a single onClick handler to a parent container and mark actionable elements with data-action attributes. In the handler, use closest('[data-action]') to identify the action and optionally read data-id for item identity, then dispatch the appropriate function.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: event-delegation Download link: https://github.com/trae-op/electron-password-generation/archive/main.zip#event-delegation Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.