Skip to content

fix(scoped-jsx): Don't add JSX import if JSX is already imported #458

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

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

henryqdineen
Copy link
Contributor

This fixes a limitation we ran into with the scoped-jsx codemod. There were a couple places that were importing { JSX } from 'react/jsx-runtime' but the new react import was still being added. I assume that that code should just be importing from 'react' to begin with but just wanted to push the PR in case it ends up being a common issue.

Copy link

changeset-bot bot commented Dec 15, 2024

🦋 Changeset detected

Latest commit: 22d460c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
types-react-codemod Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@eps1lon eps1lon changed the title fix(scoped-jsx): skip if JSX imported from jsx-runtime fix(scoped-jsx): Don't add JSX import if JSX is already imported Dec 16, 2024
Copy link
Owner

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@eps1lon eps1lon merged commit f5152b6 into eps1lon:main Dec 16, 2024
3 checks passed
@github-actions github-actions bot mentioned this pull request Dec 16, 2024
Repository owner deleted a comment from owenalcala May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants