@storybook/addons#makeDecorator TypeScript Examples
The following examples show how to use
@storybook/addons#makeDecorator.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: withCenterView.tsx From react-native-base-ui with MIT License | 6 votes |
withCenterView = makeDecorator({
name: 'withCenterView',
parameterName: '',
wrapper: (Story: any, context) => (
<View style={styles.container}>
<Story context={context} />
</View>
),
})
Example #2
Source File: index.tsx From storybook-addon-preview with MIT License | 6 votes |
withPreview = makeDecorator({
name: 'withPreview',
parameterName: 'preview',
wrapper: (storyFn, context) => {
const channel = addons.getChannel();
useChannel({
[SET]: ({ knobs }) => channel.emit("knobs", getKnobValues(knobs)),
[RESET]: () => channel.emit("knobs", {}),
});
return storyFn(context);
},
})