File tree Expand file tree Collapse file tree 1 file changed +4
-18
lines changed
src/components/common/crew-list Expand file tree Collapse file tree 1 file changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -29,17 +29,8 @@ const meta: Meta = {
2929export default meta ;
3030type 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
6147export const Default : Story = {
62- render : ( ) => < RenderCrewCardList initialData = { { pages : [ ] , pageParams : [ ] } } /> ,
48+ render : ( ) => < RenderCrewCardList /> ,
6349 args : { } ,
6450} ;
You canโt perform that action at this time.
0 commit comments