react-docgen icon indicating copy to clipboard operation
react-docgen copied to clipboard

Add a hint flag to help the parser distinguish react components

Open EduardAkhmetshin opened this issue 5 years ago • 0 comments

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.

EduardAkhmetshin avatar Apr 16 '20 19:04 EduardAkhmetshin