Parses inline component-documentation using react-docgen.
npm install --save gatsby-transformer-react-docgen
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.
An example graphql query to get nodes:
{
allComponentMetadata {
edges {
node {
displayName
description
props {
name
type
required
}
}
}
}
}