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

Props in typescript not displayed #7687

Closed
acejusto11 opened this issue Aug 5, 2019 · 9 comments
Closed

Props in typescript not displayed #7687

acejusto11 opened this issue Aug 5, 2019 · 9 comments

Comments

@acejusto11
Copy link

acejusto11 commented Aug 5, 2019

Describe the bug
The props in typescript are not displayed when component is wrapped in HOC withStyles/withTheme of material ui. Only 'innerRef' props are displayed

Expected behavior
All defined props should be displayed

Screenshots
image

Code snippets
export default withStyles(styleClasses, { index: 0, withTheme: true })(
ColorButton
);
export default withTheme(Button);

@shilman
Copy link
Member

shilman commented Aug 26, 2019

FYI addon-info is being superceded by addon-docs, which fixes a bunch of bugs and is easier to maintain. It’s reached release candidate (RC) status and will be properly released soon. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

@a-type
Copy link

a-type commented Aug 28, 2019

I see the same behavior with addon-docs. I'm building a component library which heavily relies on customizing MUI components. Sometimes I even end up re-exporting MUI components directly. Basically all of the props tables are just innerRef and classes. Not sure, but it might have to do with MUI's StandardProps type (which is the base interface for most components' props) being rather complex. I noticed that classes and innerRef are defined on the StyledComponentProps type which it inherits from. However, I'm not sure why Storybook thinks innerRef is required, for instance.

@stale
Copy link

stale bot commented Sep 18, 2019

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!

@stale stale bot added the inactive label Sep 18, 2019
@freddy-reye16
Copy link

Has anyone found a solution or workaround for this topic? I'm running into the same issue. Thanks in advance

@stale stale bot removed the inactive label Oct 10, 2019
@stale
Copy link

stale bot commented Oct 31, 2019

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!

@stale stale bot added the inactive label Oct 31, 2019
@stale stale bot removed the inactive label Nov 7, 2019
@stale
Copy link

stale bot commented Nov 28, 2019

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!

@stale stale bot added the inactive label Nov 28, 2019
@stale
Copy link

stale bot commented Dec 28, 2019

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Dec 28, 2019
@petermikitsh
Copy link
Contributor

petermikitsh commented Mar 19, 2020

This issue is still present: classes and innerRef are all that's shown for components from @material-ui/core.

Screen Shot 2020-03-19 at 4 04 18 PM

@petermikitsh
Copy link
Contributor

Workaround:

// storybook/components/Button.tsx
import * as React from "react";
import { Button as MatButton, ButtonProps } from "@material-ui/core";

export const Button: React.FC<ButtonProps> = props => <MatButton {...props} />;
// storybook/stories/1-Button.stories.tsx
import * as React from "react";
import { action } from "@storybook/addon-actions";
import { Button } from "../components/Button";

export const Text = props => (
  <Button variant="contained" color="primary" onClick={action("clicked")}>
    Hello Button
  </Button>
);

export default {
  title: "Button",
  component: Button
};

Screen Shot 2020-03-19 at 5 44 35 PM

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

5 participants