React
migration
byalexbit-codemod

React/19/Remove Context Provider

/icons/calendar.svg

Last update

Jul 24, 2024

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

Example

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