question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade to the latest react-docgen

See original GitHub issue

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) {
  ...
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sapegincommented, Sep 23, 2016

@nhavar Yep, we’ll see very son.

0reactions
sapegincommented, Sep 30, 2016

Fixed in #189.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-docgen - npm
A CLI and toolkit to extract information from React components for documentation generation.. Latest version: 5.4.3, last published: 6 ...
Read more >
reactjs/react-docgen: A CLI and toolbox to extract ... - GitHub
A CLI and toolbox to extract information from React component files for documentation generation purposes. - GitHub - reactjs/react-docgen: A CLI and ...
Read more >
react-docgen-typescript | Yarn - Package Manager
A simple parser for React properties defined in TypeScript instead of propTypes. It can be used with React Styleguidist. Installation.
Read more >
storybook-addon-react-docgen
A storybook addon to display react docgen info. This addon is a drop in replacement for the "info" addon's prop table functionality. Rather...
Read more >
react-docgen Playground
A CLI and toolbox to extract information from React component files for documentation generation purposes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found