Addon-docs: props with default values appear before props without default values in the props table
See original GitHub issueDescribe 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:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, would I be able to grab this issue?
will address in #9917