Skip to content
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

Open
anark opened this issue Oct 26, 2020 · 3 comments
Open

update-react-imports adds extra import * from React #283

anark opened this issue Oct 26, 2020 · 3 comments

Comments

@anark
Copy link

@anark anark commented Oct 26, 2020

When an import is defined as

import React, { useState } from 'react'

(usually due to automatically added imports)

The update-react-imports codemod transforms it to

import { useState } from 'react';
import * as React from 'react';

Instead of just

import { useState } from 'react';
@m-rutter
Copy link

@m-rutter m-rutter commented Oct 28, 2020

Yeah, I've notice it does this in typescript projects if you use types like React.ReactNode or React.ComponentType.

@kelly-tock
Copy link

@kelly-tock kelly-tock commented Nov 3, 2020

same here

@monic-shixi
Copy link

@monic-shixi monic-shixi commented Nov 24, 2020

+1
it will trigger import/no-duplicates lint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.