How to use the @storybook/react.story function in @storybook/react

To help you get started, we’ve selected a few @storybook/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / storybook / lib / transforms / src / __mocks__ / metadata / esmWrapped.js View on Github external
/* CASE: wrapped with Object.assign */
export const a = Object.assign(() => null, {
  title: 'A',
});

/* CASE: wrapped with story */
export const b = story(() => null, {
  title: 'B',
});

/* CASE: wrapped with story + referencing object */
const meta = {
  title: 'B',
};

export const c = story(() => null, meta);
github storybookjs / storybook / lib / transforms / src / __mocks__ / metadata / esmWrapped.js View on Github external
import { story } from '@storybook/react';

/* CASE: wrapped with Object.assign */
export const a = Object.assign(() => null, {
  title: 'A',
});

/* CASE: wrapped with story */
export const b = story(() => null, {
  title: 'B',
});

/* CASE: wrapped with story + referencing object */
const meta = {
  title: 'B',
};

export const c = story(() => null, meta);