Skip to content
Codemod to update import declarations as per react-native > 0.59.x deprecations.
Branch: master
Clone or download
Latest commit f0ef710 Jul 3, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Run with `shell: true` on Windows May 6, 2019
src Add deprecated modules on `0.60` Apr 24, 2019
.gitignore Initial commit Apr 12, 2019
.npmignore Add Travis config Apr 15, 2019
.travis.yml Add Travis config Apr 15, 2019 Initial commit Apr 9, 2019
package.json Release 0.60.0 Jul 3, 2019
yarn.lock Initial commit Apr 12, 2019

Update Deprecated Modules for React Native

This project is intended to be used from version 0.59.x which started the Lean Core Hub initiative that removes modules from the core of react-native into community-maintained projects.


Install jscodeshift:

yarn global add jscodeshift

This guide assumes that you have npx installed, if you wish to use this through a global installation just install it with yarn global add rn-update-deprecated-modules and remove npx from the example commands.


All arguments specified in jscodeshift are accepted.

npx rn-update-deprecated-modules myFile.js
npx rn-update-deprecated-modules myFile.js mySecondFile.js myThirdFile.js
npx rn-update-deprecated-modules app/**/*.js

Example output

❯ npx rn-update-deprecated-modules ./app/**/*.js
Processing 50 files...
Spawning 1 worker...
Sending 50 files to free worker...
All done.
0 errors
588 unmodified
0 skipped
1 ok
Time elapsed: 1.208seconds

 Import statements updated, run:
    yarn add @react-native-community/async-storage
-import { AsyncStorage, Image } from 'react-native';
+import { Image } from 'react-native';
+import AsyncStorage from '@react-native-community/async-storage';


MIT © Lucas Bento

You can’t perform that action at this time.