UNPKG

react-docgen

Version:

A library to extract information from React components for documentation generation.

13 lines (12 loc) 374 B
import isReactBuiltinReference from './isReactBuiltinReference.js'; /** * Returns true if the expression is a function call of the form * `React.foo(...)`. */ export default function isReactBuiltinCall(path, name) { if (!path.isCallExpression()) { return false; } const callee = path.get('callee'); return isReactBuiltinReference(callee, name); }