diff --git a/src/components/GridWrapper/index.tsx b/src/components/GridWrapper/index.tsx index 62a7bde..0bb04dd 100644 --- a/src/components/GridWrapper/index.tsx +++ b/src/components/GridWrapper/index.tsx @@ -19,7 +19,7 @@ const QuestionGrid = ({ undefined ); useEffect(() => { - setSortedData(questions.data.reverse()); + sortedData === undefined && setSortedData(questions.data.reverse()); }, []); return ( diff --git a/src/hooks/common/useInput.ts b/src/hooks/common/useInput.ts index 5364acd..ea32e34 100644 --- a/src/hooks/common/useInput.ts +++ b/src/hooks/common/useInput.ts @@ -9,6 +9,7 @@ export const useInput = (initialState?: string) => { }; const handleChangeInput = (event: ChangeEvent) => { + event.preventDefault(); if (!event.target.value) { reset(); } else { diff --git a/src/pages-edit/mypage/MyFollowingPage.tsx b/src/pages-edit/mypage/MyFollowingPage.tsx index 0f340af..107385e 100644 --- a/src/pages-edit/mypage/MyFollowingPage.tsx +++ b/src/pages-edit/mypage/MyFollowingPage.tsx @@ -13,7 +13,7 @@ import InputFill from "src/components/inputs/input-fill"; import Loading from "src/components/common/Loading"; export default function MyFollowingPage() { - const { value, handleChangeInput } = useInput(); + const { value, handleChangeInput } = useInput(""); const { followings, isLoading, refetch } = useFollowingsQuery(value); useEffect(() => {