How to use the react-docgen/dist/utils/isReactCreateClassCall.default function in react-docgen

To help you get started, we’ve selected a few react-docgen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alfa-laboratory / library-utils / react-doc / create-resolver.js View on Github external
function resolveDefinition(definition, types) {
    if (isReactCreateClassCall(definition)) {
        // return argument
        const resolvedPath = resolveToValue(definition.get('arguments', 0));
        if (types.ObjectExpression.check(resolvedPath.node)) {
            return resolvedPath;
        }
    } else if (isReactComponentClass(definition) || isDecoratedBy(definition, 'cn')) {
        normalizeClassDefinition(definition);
        return definition;
    } else if (isStatelessComponent(definition)) {
        return definition;
    }
    return null;
}
github jamesmfriedman / rmwc / scripts / docgen-resolver.js View on Github external
function resolveDefinition(definition, types) {
  if (isReactCreateClassCall(definition)) {
    // return argument
    var resolvedPath = resolveToValue(definition.get('arguments', 0));
    if (types.ObjectExpression.check(resolvedPath.node)) {
      return resolvedPath;
    }
  } else if (isReactComponentClass(definition)) {
    normalizeClassDefinition(definition);
    return definition;
  } else if (isStatelessComponent(definition)) {
    return definition;
  } else if (isSimpleTag(definition)) {
    var resolvedPath = resolveToValue(definition.get('arguments', 0));
    return resolvedPath;
  } else if (isWithMDC(definition)) {
    var resolvedPath = resolveToValue(definition.get('arguments', 0));
    return resolvedPath;
github jamesmfriedman / rmwc / scripts / docgen-resolver.js View on Github external
function isComponentDefinition(path) {
  return (
    isReactCreateClassCall(path) ||
    isReactComponentClass(path) ||
    isStatelessComponent(path) ||
    isSimpleTag(path) ||
    isWithMDC(path)
  );
}