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

[addon-info]: Story does not pass down props into root div #1312

Closed
Stupidism opened this issue Jun 18, 2017 · 4 comments
Closed

[addon-info]: Story does not pass down props into root div #1312

Stupidism opened this issue Jun 18, 2017 · 4 comments

Comments

@Stupidism
Copy link
Contributor

I tried to add some stylesheet for Story

return React.cloneElement(element, { className: 'root' }); is not working.


  .addDecorator((getStory) => {
    const element = getStory();
    if (element.type === Story) {
      // return React.cloneElement(element, { className: 'root' });
      return <div className="root">{element}</div>;
    }
    return element;
  });
@shilman
Copy link
Member

shilman commented Jun 21, 2017

@Stupidism can you give a little more context for what you're trying to do? Is it part of a repo? Thanks!

@Stupidism
Copy link
Contributor Author

I wanted to override some stylesheet of the Story component of addon-info. Because it's not very proper now. for example #1310. But className prop is ignored by this Story component. By convention unknown props should be passed down to root div.

Problem is now I need to wrap another div on the component, which would cause some problem for other decorators.

@stale
Copy link

stale bot commented Oct 31, 2017

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. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 days. Thanks!

@stale stale bot added the inactive label Oct 31, 2017
@stale
Copy link

stale bot commented Nov 2, 2017

Hey there, it's me again! I am going to help our maintainers close this issue so they can focus on development efforts 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!

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