Storybook: Addon-docs: Doesn't render values within objects

Created on 8 Jul 2020  路  10Comments  路  Source: storybookjs/storybook

Describe the bug

This is my code:

GridContainer.tsx

import React, { ReactNode } from 'react';

import { grid } from './variables';

import { Container } from './Grid.styles';

interface GridContainerProps {
  children: ReactNode;
  columns?: number;
  gutter?: number;
}

const GridContainer = ({ children, columns, gutter }: GridContainerProps) => {
  return (
    <Container columns={columns} gutter={gutter}>
      {children}
    </Container>
  );
};

GridContainer.defaultProps = {
  columns: grid.numberOfColumns,
  gutter: grid.gutter,
};

export default GridContainer;

variables.ts

const grid = {
  numberOfColumns: 12,
  gutter: 24,
};
...

export { grid, .... };

And this is the generated doc table

image

Expected behavior
Print grid object value in the "default" column

System:
OS: macOS 10.15.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 12.18.1 - ~/.asdf/installs/nodejs/12.18.1/bin/node
Yarn: 1.22.4 - ~/.asdf/installs/nodejs/12.18.1/.npm/bin/yarn
Browsers:
Chrome: 83.0.4103.116
npmPackages:
@storybook/addon-actions: 5.3.19 => 5.3.19
@storybook/addon-docs: 5.3.19 => 5.3.19
@storybook/addon-knobs: 5.3.19 => 5.3.19
@storybook/addon-links: 5.3.19 => 5.3.19
@storybook/addon-storysource: 5.3.19 => 5.3.19
@storybook/addons: 5.3.19 => 5.3.19
@storybook/preset-create-react-app: 3.0.1 => 3.0.1
@storybook/preset-typescript: 3.0.0 => 3.0.0
@storybook/react: 5.3.19 => 5.3.19

P1 docs argstable bug todo

Most helpful comment

PR is up now! https://github.com/styleguidist/react-docgen-typescript/pull/286

This doesn't solve for defaults stored in another file. but i'll wait til the next issue to fix that ;P

All 10 comments

There are too many props-related issues to support on both SB5 and SB6, so please upgrade to SB6 with npx sb@next upgrade --prerelease and if it's still an issue I'm happy to investigate. Also see MIGRATION.md for breaking changes.

The error continues even with the version 6.0.0-rc.1 :disappointed:

npmPackages:
@storybook/addon-actions: 6.0.0-rc.1 => 6.0.0-rc.1
@storybook/addon-docs: 6.0.0-rc.1 => 6.0.0-rc.1
@storybook/addon-knobs: 6.0.0-rc.1 => 6.0.0-rc.1
@storybook/addon-links: 6.0.0-rc.1 => 6.0.0-rc.1
@storybook/addon-storysource: 6.0.0-rc.1 => 6.0.0-rc.1
@storybook/addons: 6.0.0-rc.1 => 6.0.0-rc.1
@storybook/preset-create-react-app: 3.1.3 => 3.1.3
@storybook/preset-typescript: 3.0.0 => 3.0.0
@storybook/react: 6.0.0-rc.1 => 6.0.0-rc.1

Thanks for upgrading. I鈥檒l give it a look during the RC period!

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

can you try upgrading to the latest RC?

Hey @shilman, sorry for the delay man.

I still have this problem here
image

npmPackages:
    @storybook/addon-a11y: ^6.0.16 => 6.0.16 
    @storybook/addon-actions: 6.0.16 => 6.0.16 
    @storybook/addon-docs: 6.0.16 => 6.0.16 
    @storybook/addon-knobs: 6.0.16 => 6.0.16 
    @storybook/addon-links: 6.0.16 => 6.0.16 
    @storybook/addon-storysource: 6.0.16 => 6.0.16 
    @storybook/addons: 6.0.16 => 6.0.16 
    @storybook/preset-create-react-app: 3.1.4 => 3.1.4 
    @storybook/preset-typescript: 3.0.0 => 3.0.0 
    @storybook/react: 6.0.16 => 6.0.16 

hmm @hipstersmoothie does this look like an issue on the storybook side, or react-docgen-typescript?

PR is up now! https://github.com/styleguidist/react-docgen-typescript/pull/286

This doesn't solve for defaults stored in another file. but i'll wait til the next issue to fix that ;P

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Since the PR on react-docgen-typescript has been merged this should no longer be a problem. If the issue persists or didn't cover @doglasbatista's use case enough feel free to open another issue and tag me in it!

Was this page helpful?
0 / 5 - 0 ratings