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

withInfo does not understand decorators #2893

Closed
3axap4eHko opened this issue Jan 31, 2018 · 5 comments
Closed

withInfo does not understand decorators #2893

3axap4eHko opened this issue Jan 31, 2018 · 5 comments

Comments

@3axap4eHko
Copy link

When I pass decorated component, for example Button to withInfo it parses component as is, like JSS(withRouter(Button))

  • @storybook/react 16.2
  • @storybook/addon-info 3.3.11

My proposal is to provide option for addon-info to set map function component.

withInfo({
      component: () => MyUndecoratedComponent,
    })(() =>
      <Component>Click the "?" mark at top-right to view the info.</Component>
    )

or

withInfo({
      component: Component => Component.Wrapper.Inner,
    })(() =>
      <Component>Click the "?" mark at top-right to view the info.</Component>
    )
@3axap4eHko 3axap4eHko changed the title withInfo does not understanding decorators withInfo does not understand decorators Jan 31, 2018
@Hypnosphi
Copy link
Member

Related: #1735

Your proposal seems reasonable. Want to open a PR?

@stale
Copy link

stale bot commented Mar 17, 2018

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 60 days. Thanks!

@stale stale bot added the inactive label Mar 17, 2018
@3axap4eHko
Copy link
Author

ping

@stale stale bot removed the inactive label Mar 20, 2018
@stale
Copy link

stale bot commented Apr 10, 2018

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!

@wuweiweiwu
Copy link
Member

can be done using propTables and propTablesExclude options together.

ex:

propTablesExclude: [HOC(Component)],
propTables [Component]

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

3 participants