-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5806 from storybooks/5781-document-decorator-changes
Allow local decorators via params
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
examples/official-storybook/stories/core/decorators.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
|
||
// We would need to add this in config.js idomatically however that would make this file a bit confusing | ||
import { addDecorator } from '@storybook/react'; | ||
|
||
addDecorator((s, { kind }) => | ||
kind === 'Core|Decorators' ? ( | ||
<> | ||
<p>Global Decorator</p> | ||
{s()} | ||
</> | ||
) : ( | ||
s() | ||
) | ||
); | ||
|
||
export default { | ||
title: 'Core|Decorators', | ||
decorators: [ | ||
s => ( | ||
<> | ||
<p>Kind Decorator</p> | ||
{s()} | ||
</> | ||
), | ||
], | ||
}; | ||
|
||
export const all = () => <p>Story</p>; | ||
all.parameters = { | ||
decorators: [ | ||
s => ( | ||
<> | ||
<p>Local Decorator</p> | ||
{s()} | ||
</> | ||
), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc54a7c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are pushing commits at a very fast pace (accross the whole organization).
Due to that, we cannot deploy the commit cc54a7c.
You can try again later or upgrade your plan.