babel-plugin-react-transform
babel-plugin-react-transform copied to clipboard
`addImport()` is deprecated in Babel 7
When trying to upgrade Babel 7, I experienced an error around the deprecation of addImport. Instead, the migration guide recommends using addDefault (reference: https://new.babeljs.io/docs/en/next/v7-migration-api.html#babel-core).
Error:
This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'.
Case 1: https://github.com/gaearon/babel-plugin-react-transform/blob/ccd6dc1d949df694ba571d309ebc507f8d74a27d/src/index.js#L284
Case 2: https://github.com/gaearon/babel-plugin-react-transform/blob/ccd6dc1d949df694ba571d309ebc507f8d74a27d/src/index.js#L291
I attempted to fork, but wound up spinning my wheels for too long. Any insight on how to best migrate would be much appreciated.
@joshparolin @kozlikov
You may install https://www.npmjs.com/package/metro-babel7-plugin-react-transform
and copy its lib/index.js to your node_modules/babel-plugin-react-transform/lib/index.js via postinstall script.
Switching over to react-hot-loader as prescribed is the best option (was for us at least :+1: )