Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

Correct way of documenting JSX React #8

@lipedeitos

Description

@lipedeitos

Hi! I'm using Node2DocFX to generate docs for my JSX/React componentes. I have installed and configured the Node2DocFX and it is actually working and generating the .yml in the folders that i want, so later i could get them with docfx build.

The problem is that i cannot find a way to document propTypes and properties of my component. Maybe i'm doing it the wrong way, I already did in many different ways and none of them work and dosnt generate the .yml correctly:

This Works:

/**
 * MyComponent Description.
 * @param {string} param1 - Param1 description.
 */
@MyDecorator
class MyComponent extends React.Component { }

But i would like to user propety instead, and this doesnt work:

/**
 * MyComponent Description.
 * @property {string} param1 - Param1 description.
 */
@MyDecorator
class MyComponent extends React.Component { }

Those other ways doesnt work too:

@MyDecorator
class MyComponent extends React.Component {
  /**
   * My propTypes description.
   * @property {string} prop1 - Prop 1 description.
   */
  static propTypes = {
    prop1: PropTypes.string
  }
}

@MyDecorator
class MyComponent extends React.Component {
  static propTypes = {
    /**
     * My propTypes description.
     * @property {string} prop1 - Prop 1 description.
     */
    prop1: PropTypes.string
  }
}

@MyDecorator
class MyComponent extends React.Component {
  static propTypes = {
    /** My propTypes description. */
    prop1: PropTypes.string
  }
}

I'v really tried many differente ways othar than that and none of them worked, the .yml stop being generated. What is the correct, or the best way for documenting JSX?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions