Open okonet opened 5 years ago
@pvasek could you help since I think you did this already once.
Another problem is that type definitions are only extracted from class or functional components https://github.com/reactjs/react-docgen/blob/master/src/utils/getFlowTypeFromReactComponent.js#L28-L50
It looks like even if I have a resolver that resolves to components that use tagged templates like styled-components, the type annotations aren't extracted.
Consider the following example:
When used with an react-docgen-annotation-resolver, the type definitions won't be extracted.
I scoped it to this place in code that's responsible for finding type annotations: https://github.com/okonet/react-docgen/blob/8fb401089e3fe2b38d41638bc5690436e23aceb3/src/utils/getTypeAnnotation.js#L22
and it looks like it's searching for specific key
typeAnnotation
in the AST. For styled-component example, though, it won't present. But what's going to present isSo, it looks like there is something related to types in there but its not being properly handled.
Does anyone has any pointers on how to fix it?