Storybook
Failed to fetch dynamically imported module: http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/@storybook_addon-interactions_preview.js?v=ca377e5c The file doe…
storybook.js.org tags: ['autodocs'], でオンだけど、逆に特定コンポーネントだけではdocs生成オフにしたいことがある。(absoluteの要素とか…) tags: ['!autodocs'], これでいける。
https://storybook.js.org/docs/essentials/backgrounds import { WhiteButton } from './WhiteButton'; const meta: Meta<typeof WhiteButton> = { title: 'common/WhiteButton', component: WhiteButton, parameters: { backgrounds: { default: 'dark', }, }, };</typeof>
storybook.js.org qiita.com decorators: [ Story => ( <div style={{ width: '216px' }}> <Story /> </div> ), ], これでこのコンポーネントのStoryは全てこのdivに包まれる。
index.stories.tsx importする、Metaがいる import { Story, Meta } from '@storybook/react/types-6-0'; descriptionでStorybookの上の方にそのコンポーネントの説明が出る subComponent指定でこのStoryからそのコンポーネントも見れる export default { ti…