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

opaque type is skipped #189

Open
DimitryDushkin opened this issue Feb 28, 2018 · 2 comments
Open

opaque type is skipped #189

DimitryDushkin opened this issue Feb 28, 2018 · 2 comments

Comments

@DimitryDushkin
Copy link

Hey! Thank you for great plugin!

We've started to use "opaque type" and I've noticed it's simply skipped by plugin. So all checks on this type fails, because it's degrades to shapeOf undefined.

Is this right, or am I doing something wrong?

Thank you.

@brigand
Copy link
Owner

brigand commented Feb 28, 2018

Thanks for bringing this up.

Could you give a code example that causes it to use shapeOf?

Also, what would you expect the behavior to be? We could treat them the same as normal types and actually do the checks, or they could be treated as any, which seems equally correct.

@marcind
Copy link
Contributor

marcind commented Apr 10, 2018

Hi there, ran into similar problems with opaque type aliases and so I put together this PR to add support by using the opaque type alias's underlying type information to generate the propTypes (i.e. it behaves just like a regular type declaration).

I prefer that to treating them as any because in the project I'm working on we have a mixture of flow and non-flow-based source code so we use the generated prop types for validation of the source code which has not yet been migrated.

Hope this helps.

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

No branches or pull requests

3 participants