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.

Storybook 5.0.6 react-docgen propTypes uknown !

See original GitHub issue

Describe the bug I tried storybook 5.0.6 migration progress react-docgen is not working! Am i using wrong? working in storybook 4.1

webpack.config.js

// load the default config generator.
const path = require('path');

module.exports = ({ config }) => {
  config.module.rules.push({
    test: /\.(ts|tsx)$/,
    use: [
      {
        loader: require.resolve('awesome-typescript-loader'),
      },
      // Optional
      {
        loader: require.resolve('react-docgen-typescript-loader'),
      },
    ],
  });

  config.module.rules.push({
    test: /\.scss$/,
    use: [
      require.resolve('style-loader'),
      require.resolve('css-loader'),
      require.resolve('sass-loader'),
    ],
  });

  config.resolve.modules.push(path.join(__dirname, '../'));
  config.resolve.extensions.push('.ts', '.tsx');
  return config;
};

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
y0ccommented, Apr 11, 2019

I solved the problem, but I couldn’t figure out the exact cause. when updating version 5.0.6 it executed the command rm -rf node_modules yarn.lock && yarn this part seems to be a problem. It seems that there was a problem among some submodules.

This is the yarn.lock file that fixes the problem. https://github.com/y0c/react-datepicker/commit/204a1ab70d9b151829ec16b71814cab96aab6a43

2reactions
y0ccommented, Apr 8, 2019

@shilman I tried in version 5.0.0 but the results were the same. The typescript interface is as follows:

interface RangeDatePickerProps {
  /** To display input format (Day.js format) */
  dateFormat: string;
  /** Initial Calendar base date(if start date not set) */
  initialDate: dayjs.Dayjs;
  /** Initial Start Date */
  initialStartDate?: dayjs.Dayjs;
  /** Initial End Date */
  initialEndDate?: dayjs.Dayjs;
  /** RangeDatePicker change event */
  onChange?: (start?: dayjs.Dayjs, end?: dayjs.Dayjs) => void;
  /** start day display this prop(optional) */
  startText: string;
  /** end day display this prop(optional) */
  endText: string;
  /** calendar wrapping element */
  wrapper?: (calendar: JSX.Element) => JSX.Element;
}

In 4.x version working perfect. As shown in the code below, several "Prop"s were combined to function normally. but 5.x version combine prop and propTypes is not working.

export type Props = RangeDatePickerProps & CalendarProps & InputProps & PickerProps;

image

https://github.com/y0c/react-datepicker is my repository url

Read more comments on GitHub >

github_iconTop Results From Across the Web

No propTypes/description column for React class components
When defining a react component with a class extending from React.Component the type and docgen description do not appear in the props table....
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.
Read more >
Issue with Storybook autogenerating docs/prop description for ...
I can get the Storybook controls to load properly. But the ArgsTable in the docs section does not respect my comments that I...
Read more >
Compare Versions | @storybook/react | npm
Storybook for React: Develop React Component in isolation with Hot Reloading. ... unknown. Security Advisories. Security Advisories. In the dependencies.
Read more >
CHANGELOG.md ... - GitCode
Storybook is a frontend workshop for building UI components and pages in ... Addon-docs: Remove render preprocessing for react components w/o docgen (#11195) ......
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