Skip to content

Commit 84780af

Browse files
committed
๐Ÿšจ Fix: ๋นŒ๋“œ ์˜ค๋ฅ˜ ์ˆ˜์ •
1 parent 7642e5b commit 84780af

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

โ€Žsrc/components/common/crew-list/crew-card-list.stories.tsxโ€Ž

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,8 @@ const meta: Meta = {
2929
export default meta;
3030
type Story = StoryObj<typeof meta>;
3131

32-
function RenderCrewCardList({
33-
initialData,
34-
}: {
35-
initialData: InfiniteData<MainCrewListResponse | undefined>;
36-
}) {
37-
const [data, setData] = useState<InfiniteData<MainCrewListResponse | undefined>>(initialData);
38-
const {
39-
data: CrewCardListData,
40-
ref,
41-
isFetchingNextPage,
42-
} = useInfiniteScroll(
32+
function RenderCrewCardList() {
33+
const { data, ref, isFetchingNextPage } = useInfiniteScroll(
4334
useGetCrewListQuery({
4435
keyword: '',
4536
mainLocation: '',
@@ -49,16 +40,11 @@ function RenderCrewCardList({
4940
}),
5041
);
5142

52-
useEffect(() => {
53-
if (CrewCardListData) {
54-
setData(CrewCardListData);
55-
}
56-
}, [CrewCardListData]);
57-
43+
if (!data) return null;
5844
return <CrewCardList data={data} ref={ref} isFetchingNextPage={isFetchingNextPage} />;
5945
}
6046

6147
export const Default: Story = {
62-
render: () => <RenderCrewCardList initialData={{ pages: [], pageParams: [] }} />,
48+
render: () => <RenderCrewCardList />,
6349
args: {},
6450
};

0 commit comments

Comments
ย (0)