Skip to content

Commit

Permalink
Merge pull request #57 from Qfeed-Dev/feature/#35
Browse files Browse the repository at this point in the history
[Feat] useInput preventDefault 추가
  • Loading branch information
hamo-o authored Sep 3, 2023
2 parents 74ec743 + d2d613a commit f48ae0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/GridWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const QuestionGrid = ({
undefined
);
useEffect(() => {
setSortedData(questions.data.reverse());
sortedData === undefined && setSortedData(questions.data.reverse());
}, []);

return (
Expand Down
1 change: 1 addition & 0 deletions src/hooks/common/useInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const useInput = (initialState?: string) => {
};

const handleChangeInput = (event: ChangeEvent<HTMLInputElement>) => {
event.preventDefault();
if (!event.target.value) {
reset();
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/pages-edit/mypage/MyFollowingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit f48ae0b

Please sign in to comment.