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.

Addon-docs: props with default values appear before props without default values in the props table

See original GitHub issue

Describe the bug If a prop have a default value, it will be displayed in the props tables before a prop without a default value.

Expected behavior All props should appear in the same order as they are defined, no matter if they have a default value or not.

An easy way to fix this, would be to sort the props alphabetically. IMO it would also make the documentation easier to read.

Screenshots

For the following prop types:

static propTypes = {
        /**
         * A controlled start date value.
         */
        startDate: momentType,
        reactDatesCalendar: node,
};

The following is rendered:

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Joseph-Whiunuicommented, Oct 24, 2019

Hi, would I be able to grab this issue?

0reactions
shilmancommented, Feb 25, 2021

will address in #9917

Read more comments on GitHub >

github_iconTop Results From Across the Web

DocsPage - Storybook - JS.ORG
Component parameter. Storybook uses the component key in the story file's default export to extract the component's description and props.
Read more >
A complete guide to React default props - LogRocket Blog
Cover three ways to implement default props in React and provide default values for props that are not required by the component.
Read more >
Documenting design systems with Storybook Docs
argTypes overrides default prop type values (field values can be found here); decorators wraps all component stories. This is useful for ...
Read more >
Storybook Docs with mdx support and addon knobs - Medium
isRequired to your propType adds a * to it in the table. Default: To indicate a default value, use defaultProps in your components....
Read more >
Compare DocsPage and MDX syntax in Storybook with example
card.stories.mdx --> import { Meta } from '@storybook/addon-docs/blocks'; ... Although our Card component has default values for its props , on initial ......
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