npx skills add ...
npx skills add github/awesome-copilot --skill react18-legacy-context
npx skills add github/awesome-copilot --skill react18-legacy-context
Provides the complete migration pattern for React legacy context API (contextTypes, childContextTypes, getChildContext) to the modern createContext API. Use this skill whenever migrating legacy context in class components - this is always a cross-file migration requiring the provider AND all consumers to be updated together. Use it before touching any contextTypes or childContextTypes code, because migrating only the provider without the consumers (or vice versa) will cause a runtime failure. Always read this skill before writing any context migration - the cross-file coordination steps here prevent the most common context migration bugs.
Legacy context (contextTypes, childContextTypes, getChildContext) was deprecated in React 16.3 and warns in React 18.3.1. It is removed in React 19.
Unlike most other migrations that touch one file at a time, context migration requires coordinating:
Missing any consumer leaves the app broken - it will read from the wrong context or get undefined.
references/single-context.md - complete migration for one context (theme, auth, etc.) with provider + class consumer + function consumerreferences/multi-context.md - apps with multiple legacy contexts (nested providers, multiple consumers of different contexts)references/context-file-template.md - the standard file structure for a new context module