How to use gatsby-transformer-react-docgen - 2 common examples

To help you get started, we’ve selected a few gatsby-transformer-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 jquense / react-widgets / www / gatsby-config.js View on Github external
let typeName = type && type.raw &&
  type.raw.replace('CustomPropTypes.', '');

  if (type && type.name === 'shape' && type.value) {
    Object.keys(type.value).forEach((key) => {
      type.value[key] = setDefaults({ type: type.value[key] }, key, widgetName).type
    })
  }

  if (defaultTypes[typeName]) {
    desc.type = Object.assign({}, type, defaultTypes[typeName]);
  }

  if (defaultDescriptions[name]) {
    let dft = defaultDescriptions[name]
    if (!cleanDoclets(desc.description)) {
      desc.description = dft({ name: widgetName }) + '\n' + desc.description || '';
    }
  }

  return desc
}
github react-bootstrap / react-bootstrap / www / gatsby-config.js View on Github external
docs._props.forEach((_, name) => {
              if (defaultDescriptions[name]) {
                let prop = docs.getPropDescriptor(name);
                let dflt = defaultDescriptions[name];

                if (dflt && !cleanDoclets(prop.description))
                  prop.description = `${dflt}\n${prop.description}`;
              }
            });
          },

gatsby-transformer-react-docgen

Expose React component metadata and prop information as GraphQL types

MIT
Latest version published 2 months ago

Package Health Score

87 / 100
Full package analysis