Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
migration
by
Codemod
React/19/Use Context Hook
Made for
React
Last update
May 29, 2024
This codemod will convert the usage of useContext
to the new hook format, introduced in React v19.
Examples
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