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

Prop table defaults does not pick up boolean values in typescript #9464

Closed
sami616 opened this issue Jan 15, 2020 · 1 comment
Closed

Prop table defaults does not pick up boolean values in typescript #9464

sami616 opened this issue Jan 15, 2020 · 1 comment

Comments

@sami616
Copy link

sami616 commented Jan 15, 2020

Hi, when using typescript and setting default values when destructuring props boolean values seem to be ignored, eg:

interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
  disabled?: boolean
}

const Component = ( { disabled = false, children }: Props) => <button disabled={disabled}>{children}</button>

The proptable for the above renders as expected only its missing the value 'false' in the default column. As far as i can see this is working correctly with other types, eg - strings, objects, functions etc.

@shilman
Copy link
Member

shilman commented Jan 15, 2020

Closing as dupe to #9394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants