-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update-react-imports adds extra import * from React #283
Comments
Yeah, I've notice it does this in typescript projects if you use types like |
same here |
+1 |
Any updates here? The tool does same thing with imports... Also... How I can clean React imports easily, if codemod can't do this? |
Bumping this. |
For me at least, this was in a typescript project when using React as a namespace for types. The issue in the codemod is that it isn't handling I've modded the codemod to do what I needed (someone could probably make a PR of this)
Usage:
|
thanks @lexanth for your code. Just needs to update the usage to specify the param |
From what I can tell, this is intentional. React is deprecating the The tests in this PR also show that this was intentional |
I simply replaced |
I have thought that it should remove unnecessary import React from 'react' but now it converts it to import * as React from 'react'; |
When an import is defined as
(usually due to automatically added imports)
The update-react-imports codemod transforms it to
Instead of just
The text was updated successfully, but these errors were encountered: