React
migration
bycodemod.com

React/19/Remove Context Provider

/icons/badge-info.svg

Made for

React

/icons/calendar.svg

Last update

May 14, 2024

This codemod will remove the usage of Provider for contexts; e.g., Context.Provider to Context

Before:

function App() {
const [theme, setTheme] = useState('light');
// ...
return (
<UseTheme.Provider value={theme}>
<Page />
</UseTheme.Provider>
);
}

After:

function App() {
const [theme, setTheme] = useState('light');
// ...
return (
<UseTheme value={theme}>
<Page />
</UseTheme>
);
}

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now