react-docgen
Version:
A library to extract information from React components for documentation generation.
8 lines (7 loc) • 403 B
TypeScript
import type { NodePath } from '@babel/traverse';
import type { ClassDeclaration, ClassExpression } from '@babel/types';
/**
* Returns `true` of the path represents a class definition which either extends
* `React.Component` or has a superclass and implements a `render()` method.
*/
export default function isReactComponentClass(path: NodePath): path is NodePath<ClassDeclaration | ClassExpression>;