From 9422faa8dccb6ee0cedf0893592c8040cea34c47 Mon Sep 17 00:00:00 2001 From: goeun208 Date: Sat, 16 Mar 2024 00:24:55 +0900 Subject: [PATCH] Fix --- src/components/main/index.tsx | 2 +- src/hooks/useGetGroupBestRegionPlace.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/main/index.tsx b/src/components/main/index.tsx index 478caea..1e1e2b8 100644 --- a/src/components/main/index.tsx +++ b/src/components/main/index.tsx @@ -33,7 +33,7 @@ const Main = ({ id }: MainProps) => { const [lat, setLat] = useState(0); const [lng, setLng] = useState(0); - const [local, setLocal] = useState(''); + const [local, setLocal] = useState(null); const [userPath, setUserPath] = useState([]); const [otherUserPath, setOtherUserPath] = useState([]); diff --git a/src/hooks/useGetGroupBestRegionPlace.ts b/src/hooks/useGetGroupBestRegionPlace.ts index b2b1377..78ab143 100644 --- a/src/hooks/useGetGroupBestRegionPlace.ts +++ b/src/hooks/useGetGroupBestRegionPlace.ts @@ -5,8 +5,11 @@ import { useQuery } from '@tanstack/react-query'; export const useGetGroupBestRegionPlace = (x: string, y: string, local: string, keyword: KeywordType) => { return useQuery( - ['useGetGroupBestRegionPlace', keyword], + ['useGetGroupBestRegionPlace', local], () => getGroupBestRegionPlace(x, y, local, keyword), + { + enabled: !!local, + }, // { // staleTime: 300 * 1000, // },