Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon-docs: default value is an integer when it should be undefined [CRA + TS] #9827

Closed
taze-fullstack opened this issue Feb 12, 2020 · 3 comments
Labels
addon: docs block: props bug cra Prioritize create-react-app compatibility typescript

Comments

@taze-fullstack
Copy link

taze-fullstack commented Feb 12, 2020

Describe the bug
The default value on the prop table is an integer when it should be undefined.

To Reproduce
Steps to reproduce the behavior:

  1. Setup CRA + typescript
  2. add a component with an interface containing two or more props
  3. define only one defaultProp

Expected behavior
Only the defined default prop must contain a value. Instead, others have integers on them.

Screenshots
image

Code snippets

export interface HelloProps {
  title: string;
  foo: boolean;
  bar?: string[];
}

const Hello = ({title}: HelloProps) => {
  return <div className="hello">Hello Component {title}</div>;
};

Hello.defaultProps = {
  title: 'this is the default :)',
};

export default Hello;

System:

Environment Info:

  System:
    OS: Windows 10 10.0.18363
    CPU: (4) x64 Intel(R) Core(TM) i3-4170 CPU @ 3.70GHz
  Binaries:
    Node: 12.14.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.449.0

Additional context
Add any other context about the problem here.

@shilman shilman added addon: docs block: props cra Prioritize create-react-app compatibility typescript bug labels Feb 12, 2020
shilman added a commit that referenced this issue Feb 14, 2020
@shilman
Copy link
Member

shilman commented Feb 14, 2020

Repro: 05f44c1

@shilman
Copy link
Member

shilman commented Feb 21, 2020

Egads!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.17 containing PR #9873 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Feb 21, 2020
@shilman
Copy link
Member

shilman commented Feb 25, 2020

Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.14 containing PR #9873 that references this issue. Upgrade today to try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: docs block: props bug cra Prioritize create-react-app compatibility typescript
Projects
None yet
Development

No branches or pull requests

2 participants