react-useref
CommunityMaster useRef for React state and DOM.
Authorb4r7x
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill clarifies the appropriate use of useRef in React, distinguishing it from useState and demonstrating its application for DOM manipulation, mutable value storage, and integration with external libraries, while also highlighting modern alternatives like useEffectEvent.
Core Features & Use Cases
- Distinguish useRef vs. useState: Understand when to use
useRef(no re-render on change) versususeState(re-render on change). - DOM Access: Imperatively interact with DOM elements (e.g., focusing inputs, measuring elements).
- Mutable Values: Store values that persist across renders without triggering UI updates (e.g., timer IDs, previous values, first render flags).
- External Libraries: Integrate with non-React libraries that require direct DOM manipulation.
- Modern React 19.2+: Understand the replacement of the
useRefworkaround for stable callbacks withuseEffectEvent.
Quick Start
Use the react-useref skill to understand how to access a DOM input element using a ref.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 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: react-useref Download link: https://github.com/b4r7x/agent-skills/archive/main.zip#react-useref 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.