Ccodemod-com-bot

react-19-remove-legacy-context

Remove legacy childContextTypes/getChildContext usage from React class components

ReactContextLegacy
Public
3 executions

Run locally

npx codemod react-19-remove-legacy-context

react-19-remove-legacy-context

Remove legacy childContextTypes and getChildContext() usage from React class components and wrap rendered JSX with a new context.

Usage

bash
Before

This is one example from the codemod's test cases. The codemod may handle many more cases.

Ready to contribute?

Build your own codemod and share it with the community.