Ryan Kim
@sysryan09027861
Reviews Written
1
Average Rating
5.0
Posts
Q&A
์นด์นด์ค ์ฃผ์ ๊ฒ์ ๊ธฐ๋ฅ 401 ์๋ฌ
(์ฌ์ง) import {useEffect, useState} from 'react'; import axios from 'axios'; import {LatLng} from 'react-native-maps'; import Config from 'react-native-config'; type Meta = { total_count: number; // ๊ฒ์์ด์ ๊ฒ์๋ ๋ฌธ์ ์ pageable_count: number; // total_count ์ค ๋ ธ์ถ ๊ฐ๋ฅํ ๋ฌธ์ ์ (์ต๋: 45) is_end: boolean; // ํ์ฌ ํ์ด์ง๊ฐ ๋ง์ง๋ง ํ์ด์ง์ธ์ง ์ฌ๋ถ same_name: { region: string[]; // ์ง์์ด์์ ์ธ์๋ ์ง์ญ์ ๋ฆฌ์คํธ keyword: string; // ์ง์์ด์์ ์ง์ญ ์ ๋ณด๋ฅผ ์ ์ธํ ํค์๋ selected_region: string; // ์ธ์๋ ์ง์ญ ๋ฆฌ์คํธ ์ค, ํ์ฌ ๊ฒ์์ ์ฌ์ฉ๋ ์ง์ญ ์ ๋ณด }; }; export type RegionInfo = { id: string; // ์ฅ์ ID place_name: string; // ์ฅ์๋ช , ์ ์ฒด๋ช category_name: string; // ์นดํ ๊ณ ๋ฆฌ ์ด๋ฆ category_group_code: string; // ์ค์ ์นดํ ๊ณ ๋ฆฌ๋ง ๊ทธ๋ฃนํํ ์นดํ ๊ณ ๋ฆฌ ๊ทธ๋ฃน ์ฝ๋ category_group_name: string; // ์ค์ ์นดํ ๊ณ ๋ฆฌ๋ง ๊ทธ๋ฃนํํ ์นดํ ๊ณ ๋ฆฌ ๊ทธ๋ฃน๋ช phone: string; // ์ ํ๋ฒํธ address_name: string; // ์ ์ฒด ์ง๋ฒ ์ฃผ์ road_address_name: string; // ์ ์ฒด ๋๋ก๋ช ์ฃผ์ x: string; // X ์ขํ๊ฐ, ๊ฒฝ์๋์ธ ๊ฒฝ์ฐ longitude (๊ฒฝ๋) y: string; // Y ์ขํ๊ฐ, ๊ฒฝ์๋์ธ ๊ฒฝ์ฐ latitude (์๋) place_url: string; // ์ฅ์ ์์ธํ์ด์ง URL distance: string; // ์ค์ฌ์ขํ๊น์ง์ ๊ฑฐ๋ฆฌ (๋จ, x,y ํ๋ผ๋ฏธํฐ๋ฅผ ์ค ๊ฒฝ์ฐ์๋ง ์กด์ฌ) }; type RegionResposne = { meta: Meta; documents: RegionInfo[]; }; function useSearchLocation(keyword: string, location: LatLng) { const [regionInfo, setRegionInfo] = useState([]); const [pageParam, setPageParam] = useState(1); useEffect(() => { (async () => { console.log('kakao : ' + Config.KAKAO_REST_API_KEY); console.log('google : ' + Config.GOOGLE_API_KEY); console.log(location.latitude, location.longitude); console.log( `https://dapi.kakao.com/v2/local/search/keyword.json?query=${keyword}&y=${location.latitude}&x=${location.longitude}&page=${pageParam}`, ); try { const {data} = await axios.get( `https://dapi.kakao.com/v2/local/search/keyword.json?query=${keyword}&y=${location.latitude}&x=${location.longitude}&page=${pageParam}`, { headers: { Authorization: `KakaoAK ${Config.KAKAO_REST_API_KEY}`, }, }, ); setRegionInfo(data.documents); } catch (error) { if (axios.isAxiosError(error)) { if (error.response) { console.error(error.response.data); console.error(error.response.status); console.error(error.response.headers); } else if (error.request) { console.error(error.request); } else { console.error(error.message); } } else { console.error(error); } } })(); }, [keyword, location, pageParam]); return {regionInfo}; } export default useSearchLocation; ์ ๋ ๊ฐ์ ๋ฒ๊ทธ ์์๊ณ , ํด๊ฒฐํ ๋ฐฉ๋ฒ ๊ณต์ ํฉ๋๋ค 1. Reset iOS SimulatorIf you are using an iOS simulator, you can reset it to clear the cache:Open the ios SiumulatorIn the top menu, go to Device > Erase All Content and Settings....Confirm the action to reset the simulator. 2. Remove and Reinstall react-native-configIf the issue persists, consider removing and reinstalling react-native-config: npm uninstall react-native-config npm install react-native-config --save cd ios xcodebuild clean cd .. npx pod-install npx react-native run-ios ์น ๋ฐ์ด๋ฒ๋ฆฌ๊ณ ๋ค์ ๋น๋ํ๋๊น ์ ๋๋ค์, simulator, xcode ์บ์ ๋ฌธ์ ์ธ๊ฒ ๊ฐ์ต๋๋ค
- 1
- 5
- 674
Q&A
Marker ๊น๋นก๊ฑฐ๋ฆผ ๋ฌธ์
์ง๋ฌธ ์ฌ๋ฆฐ ํ ์กฐ๊ธ ๋ ์ฐพ์๋ณด๋ฉด์ ํด๊ฒฐ์ ํ๋๋ฐ, ๊น๋ํ๊ฒ ํด๊ฒฐํ๋ค๋ ๋๋์ ์๋๋ค์. ๊ทธ๋๋ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๊ฒช์ผ์ค ๋ถ๋ค์ ์ํด ๊ณต์ ํฉ๋๋ค.๊ด๋ จ ์ด์: https://github.com/react-native-maps/react-native-maps/issues/3098ํด๊ฒฐ ๋ฐฉ๋ฒ: Marker ์ tracksViewChanges ์ต์ ์ false ๋ก ์ค์ ํ๋ค.const CustomMarker = ({ coordinate, color, score = 5, ...props }: CustomMarkerProps) => { console.log('custom marker'); const markerView = ( {score } {score === 3 && } {score > 3 && } ); return coordinate ? ( {markerView} ) : ( markerView ); };+๊ทธ๋ฅ false ๋ก ์ค์ ํ๋๊ฒ ๋๋ฌด ๊ป๋๋ฌ์์ ์กฐ๊ธ ๋ ์์๋ณธ ์ ๋ณด ์ ๋๋ค.tracksViewChanges ์ต์ ์ด๋?๋ง์ฝ ๊ธฐํ ์๊ตฌ์ฌํญ์ผ๋ก ์ธํด true ๋ก ํด์ผํ ๊ฒฝ์ฐ์๋ ์ด๋ป๊ฒ ๋์?๋ด ์ฝ๋์๋ ๋ฆฌ๋ ๋๋ง๋ ๋งํ ๋ถ๋ถ์ด ์๋๋ฐ, ๊น๋นก๊ฑฐ๋ฆฌ๋ ์ด์ (์ถ์ธก)https://chatgpt.com/share/08d501cb-be8b-4fc8-b69a-ebd09febe412
- 0
- 1
- 349
Q&A
refresh token ์ ๋ํ์ฌ
AI ์ฑ๋ฅ ํ์คํ๊ตฌ๋ง
- 2
- 3
- 613




