Utility library for identifying and working with React components in Babel AST transformations. Version 1.1.0 provides helper functions like isReactComponentClass to detect React component classes in Babel plugin development. Limited release cadence; focuses on providing reliable helpers for Babel plugin authors. Differentiates by specifically targeting React class components detection with accurate Babel path checking.
npm install babel-react-componentsVerified import paths — ran on the pinned version, not inferred.
Shows how to use isReactComponentClass in a Babel plugin visitor to detect React class components.
Ensure you pass a Babel NodePath object, not a node or code string.
Use additional checks for ArrowFunctionExpression, FunctionDeclaration, CallExpression with member expression (React.forwardRef), etc.
Use named import: import { isReactComponentClass } from 'babel-react-components'Run npm install babel-react-components or add to package.json dependencies.
Change to regular import: import { isReactComponentClass } from 'babel-react-components'No dependency data recorded yet.