Fritze1602 Github contribution chart
Fritze1602 Github Stats
Fritze1602 Most Used Languages

Activity

25 Nov 2022

Issue Comment

Fritze1602

Boolean default value not showing up in Addon-docs prop table

Describe the bug When using addon:docs prop table for React tsx components the boolean default values don't show up in the table.

To Reproduce

  1. Follow this guide
  2. Add some boolean prop like this:
import React, { FC } from "react";

interface ButtonProps {
  /**
   * Simple click handler
   */
  onClick?: () => void;
  /**
   * Is primary?
   */
  primary: boolean;
}

/**
 * The world's most _basic_ button
 */
export const Button: FC<ButtonProps> = ({ children, onClick }) => (
  <button onClick={onClick} type="button">
    {children}
  </button>
);

Button.defaultProps = {
  primary: true
}; 
  1. Run yarn storybook and see the result.

72208407-20e97480-349a-11ea-9255-647840810252

Expected behavior Default values showing up.

System: System: OS: Linux 5.0 Ubuntu 18.04.3 LTS (Bionic Beaver) CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz Binaries: Node: 10.18.0 - /usr/bin/node Yarn: 1.21.1 - /usr/bin/yarn npm: 6.13.4 - /usr/bin/npm Browsers: Chrome: 79.0.3945.88 Firefox: 71.0 npmPackages: @storybook/cli: ^5.3.0 => 5.3.0

Forked On 25 Nov 2022 at 06:11:22

Fritze1602

Can confirm, that the issue is still around in 6.5.13. But despite @LeandrodeLimaC workaround the default false booleans are NOT shown in the docs.

Commented On 25 Nov 2022 at 06:11:22

Fritze1602

started

Started On 03 Nov 2022 at 01:39:33

Fritze1602

started

Started On 22 Oct 2022 at 05:17:03

Fritze1602

started

Started On 19 Oct 2022 at 10:32:36

Fritze1602

started

Started On 29 Sep 2022 at 05:21:36

Fritze1602

started

Started On 23 Sep 2022 at 10:17:24

Fritze1602

started

Started On 17 Sep 2022 at 09:12:14

Fritze1602

started

Started On 13 Sep 2022 at 09:24:14

Fritze1602

started

Started On 11 Sep 2022 at 03:47:14