react-docgen
react-docgen copied to clipboard
Add a hint flag to help the parser distinguish react components
Hello. Have you considered adding a flag that would help determine react components? Something like this:
import factory from 'some-component-factory';
const Component = factory();
Component.__reactComponent = true;
export default Component;
That would be very helpful. A lot of issues here are caused by code that can't be properly parsed. Moreover, some popular packages (like styled-components) are incompatible with react-docgen and force users to use various hacks to make their components parsable.
I could write a prototype if this feature is needed.