A resolver for react-docgen that enables parsing of exports annotated with @component JSDoc tag as React components. Version 2.0.0 is stable; the package is released on npm as needed. Unlike default react-docgen resolvers that infer components from patterns like displayName or propTypes, this resolver explicitly marks any export with a @component annotation as a component, giving developers control over what gets documented.
npm install react-docgen-annotation-resolverVerified import paths — ran on the pinned version, not inferred.
Shows how to use the annotation resolver with react-docgen's parse function to extract documentation from a component annotated with @component.
Upgrade to Node >=10 or pin to v1.x if needed.
This is the intended alternative; no fix required.
Ensure your component is a default export with a JSDoc block containing @component.
Only annotate actual React components with @component.
Use import annotationResolver from 'react-docgen-annotation-resolver';
Ensure you import and pass the default function: reactDocgen.parse(source, undefined, annotationResolver);
Run npm install react-docgen-annotation-resolver --save-dev
No dependency data recorded yet.