isReactForwardRefCall.js 314 B

123456789
  1. import isReactBuiltinCall from './isReactBuiltinCall.js';
  2. /**
  3. * Returns true if the expression is a function call of the form
  4. * `React.forwardRef(...)`.
  5. */
  6. export default function isReactForwardRefCall(path) {
  7. return (isReactBuiltinCall(path, 'forwardRef') &&
  8. path.get('arguments').length === 1);
  9. }