Adding a decorator for Canvas but not Docs? #12953
Unanswered
alexsurelee
asked this question in
Help
Replies: 1 comment 2 replies
-
Starting in 6.1 (which should be released soon) there's a const decorator = (storyFn, { viewMode }) => {
if(viewMode === 'story') {
// do something
}
return storyFn();
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I'm working on a project using storybook 5 (too large to upgrade right now), and I'm trying to add
@storybook/addon-docs
to our project. Currently, we centre a lot of our components, however this doesn't play so nice with the Docs view.Is it possible to add a decorator exclusively to the canvas view, and/or remove it exclusively for the docs view?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions