React/19/Remove Context Provider

1.0.5Last update Jul 24, 2024
by@Codemod
React
migration

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