Frontend2025년 6월 15일1분 읽기

Storybook 8 — 컴포넌트 문서화와 테스트의 핵심

YS
YoungSam
조회 1572

Storybook 8 핵심

// Button.stories.tsx
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "./Button";

const meta: Meta<typeof Button> = {
  component: Button,
  tags: ["autodocs"],
  argTypes: {
    variant: { control: "select", options: ["primary", "secondary"] },
  },
};
export default meta;

export const Primary: StoryObj<typeof Button> = {
  args: { children: "클릭", variant: "primary" },
};

새로운 기능

  • RSC 지원
  • 비주얼 테스트 내장
  • 성능 2배 향상
StorybookComponentTesting

댓글 0

아직 댓글이 없습니다.