ref-patterns - Design and review React ref usage
Design and review React refs for DOM access, mutable instance values, ref forwarding, callbacks, and controlled imperative APIs without replacing reactive state.
Tags
Updated: 2026-11-08Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Distinguish refs from state
- Use useRef for DOM access
- Manage ref callback lifecycles
- Forward refs through components
- Apply React 19 ref-as-prop
- Expose controlled imperative APIs
- Compose compound-component refs
- Review ref misuse
Inputs
- React component code
- React version
- Ref usage requirements
- DOM integration requirements
Outputs
- Ref design guidance
- Code review findings
- Ref usage recommendations
Requirements
- React codebase
- Read and Grep access
