react-docgenHomeHomeDocsDocsPlaygroundPlayground
GitHubGitHub (opens in a new tab)
  • Getting started
    • Node.js
    • CLI
  • Extending
    • Architecture
    • Resolver
    • Handler
    • Importer
  • Reference
    • Config
    • API
    • Documentation
      • Basic
      • PropTypes
      • TypeScript
      • Flow
    • FileState
    • Handlers
      • childContextTypeHandler
      • codeTypeHandler
      • componentDocblockHandler
      • componentMethodsHandler
      • contextTypeHandler
      • defaultPropsHandler
      • displayNameHandler
      • propDocblockHandler
      • propTypeCompositionHandler
      • propTypeHandler
    • CLI
  • Release Notes
    • react-docgen
    • @react-docgen/cli
  • Home
  • Docs
    • Getting started
      • Node.js
      • CLI
    • Extending
      • Architecture
      • Resolver
      • Handler
      • Importer
    • Reference
      • Config
      • API
      • Documentation
        • Basic
        • PropTypes
        • TypeScript
        • Flow
      • FileState
      • Handlers
        • childContextTypeHandler
        • codeTypeHandler
        • componentDocblockHandler
          • Examples
          • Output
        • componentMethodsHandler
        • contextTypeHandler
        • defaultPropsHandler
        • displayNameHandler
        • propDocblockHandler
        • propTypeCompositionHandler
        • propTypeHandler
      • CLI
    • Release Notes
      • react-docgen
      • @react-docgen/cli
    • Playground
  • Playground

On This Page

  • Examples
  • Output
Question? Give us feedback → (opens in a new tab)Edit this page
Docs
Reference
Handlers
componentDocblockHandler

componentDocblockHandler

Reads the react components leading block comment and adds its content as description to the documentation. This works on all component types.

Examples

When the componentDocblockHandler is active the following component will result in the output below

component.tsx
/**
 * This is my component and this is its description.
 */
() => <div />;

Output

JSON
[
  {
    "description": "This is my component and this is its description."
  }
]
codeTypeHandlercomponentMethodsHandler