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

fix(replaceType): avoid modifying import not from 'react' #456

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

henryqdineen
Copy link
Contributor

This fixes an edge case we ran into where ReactNodeArray was being imported from 'prop-types' but still being modified. The fix is to consider whether a named import exists when looking for references to that import. I'm aware that prop-types are going away in React 19 but I was modifying a React 18 codebase for forwards compatibility.

This fix also caught a typo with the "in type parameters" test.

Copy link

changeset-bot bot commented Dec 12, 2024

🦋 Changeset detected

Latest commit: fd0aa49

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

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 5614a5f into eps1lon:main Dec 12, 2024
3 checks passed
@github-actions github-actions bot mentioned this pull request Dec 12, 2024
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