RNTL v14: Update Dependencies
This codemod automatically updates your package.json to prepare for React Native Testing Library v14 migration.
What it does
- Removes
@types/react-test-rendererandreact-test-renderer(no longer needed) - Moves
@testing-library/react-nativetodevDependenciesif it's independencies - Updates
@testing-library/react-nativeto^14.0.0-0 - Adds
test-renderertodevDependencies, using the matching React 19 compatibility line when it can infer one:- React 19.0:
test-renderer@^1.0.0 - React 19.1:
test-renderer@^1.1.0 - React 19.2:
test-renderer@^1.2.0 - Missing or ambiguous React version:
test-renderer@^1.2.0
- React 19.0:
Usage
bash
Example
Before:
json
After:
json
Important notes
- After running the codemod, you must run your package manager to install dependencies:
bash
- The codemod sets the version to
^14.0.0-0. You can manually update this if needed. - For monorepos, the codemod processes each
package.jsonfile individually.
Next steps
- Run this codemod to update dependencies
- Run
npm install(or your package manager) to install the new dependencies - Run the async-functions codemod to update your test code:
bash
- Review and test your changes