You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[As of Babel 7.9.0](https://babeljs.io/blog/2020/03/16/7.9.0#a-new-jsx-transform-11154-https-githubcom-babel-babel-pull-11154), when using `runtime: automatic` in `@babel/preset-react` or `@babel/plugin-transform-react-jsx`, you will not need to explicitly import React for compiling jsx. This codemod removes the redundant import statements. It also converts (`import React from 'react'`) to named imports (`import * as React from 'react'`).
148
+
[As of Babel 7.9.0](https://babeljs.io/blog/2020/03/16/7.9.0#a-new-jsx-transform-11154-https-githubcom-babel-babel-pull-11154), when using `runtime: automatic` in `@babel/preset-react` or `@babel/plugin-transform-react-jsx`, you will not need to explicitly import React for compiling jsx. This codemod removes the redundant import statements. It also converts default imports (`import React from 'react'`) to named imports (e.g. `import { useState } from 'react'`).
149
149
150
-
The wizard will ask for 1 option -
150
+
The wizard will ask for 1 option -
151
151
152
-
***Destructure named imports?**: Destructures named imports (import * as React from 'react') as well as default imports. Does not do this by default.
152
+
***Destructure namespace imports as well?**: If chosen, *namespace*imports like `import * as React` will *also* be converted. By default, it's false, so only default imports (`import React`) are converted.
153
153
154
154
```sh
155
155
npx react-codemod update-react-imports <path>
@@ -207,7 +207,7 @@ To pass more options directly to jscodeshift, use `--jscodeshift="..."`. For exa
0 commit comments