Skip to content

Commit

Permalink
Merge pull request #34 from themoment-team/feature/residualarMarker
Browse files Browse the repository at this point in the history
Feature/residualar marker
  • Loading branch information
sunwoo0706 authored Jun 12, 2022
2 parents b639e2e + 7197e96 commit 86b9860
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/hooks/use-marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const useMarker = (map: kakao.maps.Map | undefined) => {
if (!(map && data)) return;
const gc = new kakao.maps.services.Geocoder();

setMarkers([]);

data.forEach(info => {
gc.addressSearch(info.location, (result, status) => {
if (status === kakao.maps.services.Status.OK) {
Expand All @@ -29,7 +31,7 @@ const useMarker = (map: kakao.maps.Map | undefined) => {
}
});
});
}, [map]);
}, [map, data]);

return markers;
};
Expand Down
11 changes: 1 addition & 10 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { NextPage } from 'next';
import Head from 'next/head';
import { Toaster } from 'react-hot-toast';
import { SWRConfig } from 'swr';

import { Map } from 'components/Map';

Expand All @@ -17,15 +16,7 @@ const Home: NextPage = () => {
content="HiRecruit을 통해 보다 뛰어난 멘토를 찾고, 혁신적인 취업준비 경험을 느끼세요."
/>
</Head>
<SWRConfig
value={{
revalidateIfStale: false,
revalidateOnFocus: false,
revalidateOnReconnect: false,
}}
>
<Map />
</SWRConfig>
<Map />
<Toaster />
</>
);
Expand Down

1 comment on commit 86b9860

@vercel
Copy link

@vercel vercel bot commented on 86b9860 Jun 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.