Welcome to react-docgen!
react-docgen
is a highly customizable library that extracts information from
React (opens in a new tab) components and returns this information in a
structured machine readable format from which documentations can be generated.
It uses Babel (opens in a new tab) to parse the source into an AST and provides methods to process this AST to extract the desired information. The output / return value is a JSON blob / JavaScript object.
It provides a default implementation for React components defined via
React.createClass
, ES2015 class definitions (opens in a new tab) or functions (stateless
components). These component definitions must follow certain guidelines in order
to be analyzable (see below for more info).
react-docgen is a low level tool to extract information about react components. If you are searching for a more high level styleguide with nice interface try react-styleguidist (opens in a new tab) or any of the other tools listed in the wiki (opens in a new tab). (TODO site with all tools using react-docgen.)