그리고 ArticlesScreen을 다음과 같이 수정하면 반대 방향으로도 페이지네이션할 수 있습니다.
screens/ArticlesScreen.tsx
(...) function () { const { data, isFetchingNextPage, fetchNextPage, fetchPreviousPage, isFetchingPreviousPage, } ( 'articles', ({pageParam}) => getArticles({...pageParam}), { (lastPage) => lastPage.length == 10 ? {cursor: lastPage[lastPage.length - 1].id} : undefined, getPreviousPageParam: (_, allPages) => { const validPage = allPages.find((page) => page.length > 0); if (!validPage) { return undefined; } return { prevCursor: validPage[0].id, }; }, }, ); const items (() => { if ( data) { return null; } return ([] as Article[]). (data.pages); }, [data]); const [user] (); if ( items) { return ( <ActivityIndicator size="large" style={styles.spinner} color="black" /> ); } return ( <Articles articles={items} showWriteButton={!!user} isFetchingNextPage={isFetchingNextPage} fetchNextPage={fetchNextPage} refresh={fetchPreviousPage} isRefreshing={isFetchingPreviousPage} /> ); } ( )