Skip to content

Latest commit

 

History

History
 
 

gatsby-transformer-react-docgen

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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
        }
      }
    }
  }
}