Skip to content

Commit

Permalink
chore: useCreateQueryString 훅 캐리지리턴 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
geongyu09 committed Aug 20, 2024
1 parent 425ca8c commit cf534d4
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions frontend/src/hooks/useCreateQueryString.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { useCallback } from "react";
import { useSearchParams } from "next/navigation";

export const useCreateQueryString = () => {
const searchParams = useSearchParams();

const createQueryString = useCallback(
(name: string[], value: string[]) => {
const params = new URLSearchParams(searchParams.toString());
name.forEach((el, index) => params.set(el, value[index] || ""));

return params.toString();
},
[searchParams]
);

return { createQueryString };
};

0 comments on commit cf534d4

Please sign in to comment.