- 디자인과 개발 단계에서 재사용할 수 있는 UI 컴포넌트를 먼저 만든다면, 재사용성과 효율성이 극대화 될 수 있다.
- CDD는 부품단위로 UI 컴포넌트를 만들어 나가는 개방 방법이다.
# Clone the template
npx degit chromaui/intro-storybook-react-template taskbox
cd taskbox
# Install dependencies
yarn
# Run the test runner (Jest) in a terminal:
yarn test --watchAll
# Start the component explorer on port 6006:
yarn storybook
# Run the frontend app proper on port 3000:
yarn start
출처 (공식문서) : https://storybook.js.org/tutorials/intro-to-storybook/react/en/get-started/
import React from "react";
import { Button } from "@storybook/react/demo";
export default {
title: "Button",
component: Button
};
export const Primary = () => (
<Button>Hello Button</Button>
);
export const Secondary = () => (
<Button>Bye Button</Button>
);
참고 자료 : 코드 스테이츠