Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
React
migration
byalexbit-codemod
React/19/Replace Act Import
Last update
Jul 24, 2024
This codemod will replace the usages of TestUtils.act()
to use React.act()
, introduced in React v19.
Example
Before:
import { act } from 'react-dom/test-utils';act();
After:
import { act } from "react";act();
Before:
import * as ReactDOMTestUtils from 'react-dom/test-utils';ReactDOMTestUtils.act();
After:
import * as React from "react";React.act();
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community