How to use the react-desc.getDocAsJSON function in react-desc

To help you get started, we’ve selected a few react-desc 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 grommet / grommet-docs / src / components / ComponentDoc.js View on Github external
export default (props) => {
  const { component, examples, hero, properties } = props;

  const componentDoc = getDocAsJSON(component);
  
  const propertiesNode = componentDoc.properties.map((property, index) => {
    let defaultVaule = '';
    if (property.defaultValue) {
      defaultVaule = [
        `The default is `,
        <b>
          {property.defaultValue.toString()}
        </b>,
        '.'
      ];
    }
    let format = `{${property.format}}`.replace(/,/g, '|');
    if (property.format === 'boolean') {
      format = '{true|false}';
      if (typeof property.defaultValue === 'undefined') {