Skillquality 0.70

react18-string-refs

Provides exact migration patterns for React string refs (ref="name" + this.refs.name) to React.createRef() in class components. Use this skill whenever migrating string ref usage - including single element refs, multiple refs in a component, refs in lists, callback refs, and refs

Price
free
Protocol
skill
Verified
no

What it does

React 18 String Refs Migration

String refs (ref="myInput" + this.refs.myInput) were deprecated in React 16.3, warn in React 18.3.1, and are removed in React 19.

Quick Pattern Map

PatternReference
Single ref on a DOM element→ patterns.md#single-ref
Multiple refs in one component→ patterns.md#multiple-refs
Refs in a list / dynamic refs→ patterns.md#list-refs
Callback refs (alternative approach)→ patterns.md#callback-refs
Ref passed to a child component→ patterns.md#forwarded-refs

Scan Command

# Find all string ref assignments in JSX
grep -rn 'ref="' src/ --include="*.js" --include="*.jsx" | grep -v "\.test\."

# Find all this.refs accessors
grep -rn "this\.refs\." src/ --include="*.js" --include="*.jsx" | grep -v "\.test\."

Both should be migrated together - find the ref="name" and the this.refs.name accesses for each component as a pair.

The Migration Rule

Every string ref migrates to React.createRef():

  1. Add refName = React.createRef(); as a class field (or in constructor)
  2. Replace ref="refName"ref={this.refName} in JSX
  3. Replace this.refs.refNamethis.refName.current everywhere

Read references/patterns.md for the full before/after for each case.

Capabilities

skillsource-githubskill-react18-string-refstopic-agent-skillstopic-agentstopic-awesometopic-custom-agentstopic-github-copilottopic-hacktoberfesttopic-prompt-engineering

Install

Quality

0.70/ 1.00

deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 30706 github stars · SKILL.md body (1,478 chars)

Provenance

Indexed fromgithub
Enriched2026-04-21 18:52:23Z · deterministic:skill-github:v1 · v1
First seen2026-04-18
Last seen2026-04-21

Agent access