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…

INSTALLATION
npx skills add https://github.com/github/awesome-copilot --skill react18-string-refs
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

$28

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.refName` → `this.refName.current` everywhere

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

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card