Switch branches/tags
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
src
.babelrc
.gitignore
.npmignore
CHANGELOG.md
README.md
index.js
package.json

README.md

gatsby-transformer-react-docgen

Parses inline component-documentation using react-docgen.

Install

npm install --save gatsby-transformer-react-docgen

Usage

Add a plugin-entry to your gatsby-config.js

module.exports = {
  // ...,
  plugins: [...`gatsby-transformer-react-docgen`],
}

You'll also need to include a source-plugin, such as gatsby-source-filesystem, so that the transformer has access to source data.

Note that at least one of your React Components must have PropTypes defined.

How to query

An example graphql query to get nodes:

{
  allComponentMetadata {
    edges {
      node {
        displayName
        description
        props {
          name
          type
          required
        }
      }
    }
  }
}