Skip to content

Nested type descriptions #683

@neutraali

Description

@neutraali

Sorry if this has been reported before in some form before, but is there currently support for nested type descriptions? For example, given the following structure (using Flow and react-docgen@5.3.1):

type Panel = {
	/** Panel title */
	title: string,
	/** Panel content */
	content: string,
	/** Sublevels of more Panels */
	panels: Array<Panel>
};

type Props = {
	/** One or more toggleable Panels */
	panels: Array<Panel>
}

/** Hello World! */
const Component = (props: Props) => { ... }

^ Does not generate any description for the Panel -props. Is this intentional? The output for a Panel is:

{
	"name": "signature",
	"type": "object",
	"raw": "{ ... }",
	"signature": {
		"properties": [
			{
				"key": "title",
				"value": {
					"name": "string",
					"required": true
				}
			},
			{
				"key": "content",
				"value": {
					"name": "string",
					"required": true
				}
			},
			{
				"key": "panels",
				"value": {
					"name": "Array",
					"elements": [{ "name": "Panel" }],
					"raw": "Array<Panel>",
					"required": true
				}
			}
		]
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions