Skip to content

Upgrade to the latest react-docgen #180

@ryanswanson

Description

@ryanswanson

The latest version of react-docgen includes fixes for support of union types in JSDoc, which would be really great to have supported in react-styleguidist as well.

https://github.com/reactjs/react-docgen/commits/v2.10.0

I discovered this by tracking down the following console error (styleguidist server console - not JavaScript console).

Error when parsing src/components/select/Select.js
TypeError: Cannot read property 'name' of undefined

Here is an example of the offending JSDoc comment: Note the union type of {(string|number)}.

/**
 * Retrieve a value from the given options and valueKey
 * @param {(string|number)} value - the selected value(s)
 * @param {Object} props - the Select component's props (or nextProps)
 */
expandValue(value, props) {
  ...
}

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