Ccodemod-com-bot

react-19-replace-react-test-renderer-import

Replace react-test-renderer shallow renderer imports with react-shallow-renderer

Reactreact-test-renderershallowmigration
Public
3 executions

Run locally

npx codemod react-19-replace-react-test-renderer-import

react-19-replace-react-test-renderer-import

Replace react-test-renderer/shallow module specifiers with react-shallow-renderer.

This codemod mirrors react/19/replace-react-test-renderer-import from codemod/commons.

Usage

bash

Example

Before

tsx

After

tsx

Behavior

  • Rewrites ESM import declarations.
  • Rewrites direct CommonJS require("react-test-renderer/shallow") calls.
  • Also rewrites export-from declarations and dynamic import(...) calls that reference the same module specifier.
  • Does not rewrite arbitrary string literals or require.resolve(...) calls.

Ready to contribute?

Build your own codemod and share it with the community.