fbredius/storybook

View on GitHub
examples/cra-ts-kitchen-sink/.storybook/localAddon/register.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import { addons, types } from '@storybook/addons';

const ID = 'local-addon';

const LocalAddonPanel = () => <>Local addon</>;

addons.register(ID, (api) =>
  addons.add(ID, {
    title: ID,
    type: types.PANEL,
    match: () => true,
    render: ({ active, key }) => (active ? <LocalAddonPanel key={key} /> : null),
  })
);