1.1.2 • Published 3 years ago

storybook-addon-react-context v1.1.2

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

React Context Addon

npm version npm CircleCI David Snyk Vulnerabilities for GitHub Repo


Installation

yarn add storybook-addon-react-context --dev

Add to .storybook/addons.js

import 'storybook-addon-react-context/dist/register';

addDecorator to .storybook/config.js

import { addDecorator } from '@storybook/react';
import { withContextProvider } from 'storybook-addon-react-context';

import { ReactContextProvider } from './path/to/file';

addDecorator(withContextProvider({
  provider: ReactContextProvider,
  options: [
    {
      value: '1',
      label: 'one'
    },
    {
      value: '2',
      label: 'two'
    }
  ]
}));

This is used for displaying in the Storybook UI.

Contributing

yarn

yarn build

yarn example

Thanks

Thanks to Carlos for making storybook-addon-styled-component-theme and upon which this library was based on top of.