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
My first thought for a fix would be to preserve that default import from react by only assigning on L136 if state.reactImportedName is falsy. But obviously I'm not intimately familiar with the rest of the codebase so not sure if that causes any unwanted side effects somewhere else 😅.
Please let me know if you have any pointers for a fix - I'd be happy to put up a PR 😄.
The text was updated successfully, but these errors were encountered:
Hi, thanks for all your work on this - it's an awesome plugin!
I'm running into an issue where if I have a type import from react separate from the default import like so
The plugin will not output any propTypes for the component. Switching the order of the imports will fix the issue:
Did a little bit of digging and it looks like the second import (the type import here) overrides the default import found from the first import here:
babel-plugin-typescript-to-proptypes/src/index.ts
Lines 133 to 137 in 25b74f3
Which ends up short circuiting the plugin execution:
babel-plugin-typescript-to-proptypes/src/index.ts
Lines 163 to 166 in 25b74f3
My first thought for a fix would be to preserve that default import from react by only assigning on L136 if
state.reactImportedName
is falsy. But obviously I'm not intimately familiar with the rest of the codebase so not sure if that causes any unwanted side effects somewhere else 😅.Please let me know if you have any pointers for a fix - I'd be happy to put up a PR 😄.
The text was updated successfully, but these errors were encountered: