Skip to content

Commit

Permalink
refactor: 이벤트 핸들러 함수와 훅의 사용 순서 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
CheeseB committed Mar 22, 2024
1 parent 22ea8b9 commit ab5dfa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/mypage/MyPosts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ const MyPosts = () => {

const pageSize = getPostPageSize(currentDeviceType);

const handleClickPage = (pageNumber: number) => setPage(pageNumber);
const handleSelectFilter = (selectedId: string) => setSelectFilter({ category: selectedId });
const handleOptionChange = (value: string | number) => setSortOption((prev) => ({ ...prev, order: value as Order }));

const { pagedDataList, totalCount } = useProcessedDataList({
initialDataList: MockApiResponse.activities,
selectFilter,
Expand All @@ -66,6 +62,10 @@ const MyPosts = () => {
postsPerPage: pageSize,
});

const handleClickPage = (pageNumber: number) => setPage(pageNumber);
const handleSelectFilter = (selectedId: string) => setSelectFilter({ category: selectedId });
const handleOptionChange = (value: string | number) => setSortOption((prev) => ({ ...prev, order: value as Order }));

return (
<div className={cx('mypost-container')}>
<div className={cx('title-area')}>
Expand Down

0 comments on commit ab5dfa1

Please sign in to comment.