
React18 Legacy Context
github/awesome-copilotOfficial
Migrates React legacy context (contextTypes, childContextTypes, getChildContext) to createContext across provider and consumers.
- skills.sh installs
- 749
- GitHub stars
- 41.4K
- last updated
- Aug 21, 2026
What it does
- Covers provider and consumer updates for legacy context in React 18, which requires all files to change together
- Includes a 6-step ordered workflow, three
grepscan commands, and three reference files for single, multi-context, and new-module templates - Enforces provider-and-consumer updates together because migrating only one side causes runtime failures or undefined context reads
- Designed for class and function component codebases on React 18.3.1 that must clear legacy context warnings before React 19
Install
$ npx -y skills add github/awesome-copilot --skill react18-legacy-context -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React 18 Legacy Context Migration
Legacy context (contextTypes, childContextTypes, getChildContext) was deprecated in React 16.3 and warns in React 18.3.1. It is removed in React 19.
This Is Always a Cross-File Migration
Unlike most other migrations that touch one file at a time, context migration requires coordinating:
- Create the context object (usually a new file)
- Update the provider component
- Update every consumer component
Missing any consumer leaves the app broken - it will read from the wrong context or get undefined.
Migration Steps (Always Follow This Order)
Step 1: Find the provider (childContextTypes + getChildContext)
Step 2: Find ALL consumers (contextTypes)
Step 3: Create the context file
Step 4: Update the provider
Step 5: Update each consumer (class components → contextType, function components → useContext)
Step 6: Verify - run the app, check no legacy context warnings remain
Scan Commands
# Find all providers
grep -rn "childContextTypes\|getChildContext" src/ --include="*.js" --include="*.jsx" | grep -v "\.test\."
Details
- Repository
- github.com/github/awesome-copilot
- Category
- Frontend & UI Code
- First seen
- May 16, 2026
More from github/awesome-copilot
All 293- Code Tour748
- From The Other Side Vega746
- React18 Lifecycle Patterns746
- React18 String Refs744
- React18 Enzyme To Rtl743
- Linkedin Post Formatter362
- Ui Screenshots216
- Data Breach Blast Radius110
- Sql Server Table Reconciliation106
- Aws Cloudwatch Investigation
- Aws Cost Optimize
- Aws Resource Health Diagnose
- Aws Well Architected Review
- Azure Well Architected Review
- Bug Reproduction Brief
- Incident Postmortem
- Mcp Implementation Security Review
- Pester Migration
- Tm7 Threat Model
- Git Commit48.7K
- Excalidraw Diagram Generator34.6K
- Multi Stage Dockerfile31.7K
- Documentation Writer28.6K
- Prd24.6K
Similar to React18 Legacy Context
More Frontend & UI Code
react19-source-patternsgithub/awesome-copilot995 installsMigration reference covering React 19 source-file changes, from ReactDOM API updates to ref and context rewrites.
react19-concurrent-patternsgithub/awesome-copilot1.1K installsPreserves React 18 concurrent patterns during migration, then adopts React 19 APIs in a later cleanup.
react-modernizationwshobson/agents13.2K installsUpgrade guide for React apps covering version migrations, class-to-hooks conversion, and concurrent features.
reactpproenca/dot-skills503 installsReact 19 patterns and a codebase audit algorithm covering concurrent rendering, Server Components, actions, and dedup-focused hygiene.
provider-patternpatternsdev/skills642 installsShares data across component trees through React Context, avoiding prop drilling through intermediate components.
react-patternsmanutej/luxor-claude-marketplace474 installsModern React guide covering hooks, state patterns, component composition, and performance tuning for scalable apps.