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

Add converter for TSTypeQuery #113

Closed
etlovett opened this issue Jan 14, 2020 · 1 comment · Fixed by #126
Closed

Add converter for TSTypeQuery #113

etlovett opened this issue Jan 14, 2020 · 1 comment · Fixed by #126

Comments

@etlovett
Copy link

I have a React component with a prop with the Typescript type ComponentProps<typeof OtherComponent>['type'], where OtherComponent's type prop is a union of string constants (e.g. type: 'a' | 'b' | 'c'). When I run this component through extract-react-types-loader (via require('!!extract-react-types-loader!./MyComponent.tsx')), I get the error Missing converter for: TSTypeQuery.

Per https://astexplorer.net/#/gist/1c8639f2528c0a3abeffeb6f5b06d074/0e1bfbd296ea053ce20a6829baacb858797fca90, I believe it's the typeof that produces a TSTypeQuery AST node.

FYI, I believe this issue is just a TSTypeQuery version of #59 and #75.

Thanks for a handy tool!

@danieldelcore
Copy link
Contributor

Hey @etlovett 👋

Currently there's no support for TSTypeQuery but we're keen to include it!
It would be a matter of just adding a new converter, converter.TSTypeQuery.

Not sure when we'll be able to get around to adding this, but you're more than welcome to give it a go if you're interested in contributing 😃

Cheers!

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

Successfully merging a pull request may close this issue.

2 participants