How to use the react-docgen/dist/utils/setPropDescription.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 doczjs / docz / core / docz-core / src / utils / docgen / externalProptypesHandler.ts View on Github external
}
      if (type) {
        propDescriptor.type = type
        propDescriptor.required =
          type.name !== 'custom' && isRequiredPropType(valuePath)
      }
    } else if (nodeType === types.SpreadProperty.name) {
      resolvedValuePath = utils.resolveToValue(propertyPath.get('argument'))
      // normal object literal
      if (resolvedValuePath.node.type === types.ObjectExpression.name) {
        amendPropTypes(documentation, resolvedValuePath)
      }
    }

    if (types.Property.check(propertyPath.node)) {
      setPropDescription(documentation, propertyPath)
    }
  })
}
github siddharthkp / react-docgen-external-proptypes-handler / index.js View on Github external
};
      if (type) {
        propDescriptor.type = type;
        propDescriptor.required =
          type.name !== "custom" && isRequiredPropType(valuePath);
      }
    } else if (nodeType === types.SpreadProperty.name) {
      resolvedValuePath = utils.resolveToValue(propertyPath.get("argument"));
      // normal object literal
      if (resolvedValuePath.node.type === types.ObjectExpression.name) {
        amendPropTypes(documentation, resolvedValuePath);
      }
    }

    if (types.Property.check(propertyPath.node)) {
      setPropDescription(documentation, propertyPath);
    }
  });
}