React/19/Use Context Hook

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

This codemod will convert the usage of useContext to the new hook format, introduced in React v19.

Example

Before:

import { useContext } from "react";
import UseTheme from "./UseTheme";
const theme = useContext(UseTheme);

After:

import { use } from "react";
import UseTheme from "./UseTheme";
const theme = use(UseTheme);

Build custom codemods

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

background illustrationGet Started Now