[Fix] 외부 검색 진입 시 Location undefined로 나는 오류 해결#65
Merged
yongaricode merged 1 commit intodevelopfrom Apr 9, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔥 Issues
이슈 연결
✅ What to do
📄 Description
🤔 Considerations
🐞외부 검색 진입 시 Location undefined로 나는 오류
Zip내부에서 직접 검색 시에는 정상 동작하지만, 외부에서 URL로 검색어 param(?search=...)을 포함해 접근할 경우 검색 실패useEffect에서handleSearch()가 실행되었는데, 그 시점에는 아직useGeoLocation()의location이 초기화되지 않음location이undefined상태에서 검색 API 호출이 이뤄져TypeError발생useEffect의 의존성 배열에location을 추가하여,location이 초기화된 이후에만handleSearch()가 실행되도록 조정location존재 여부까지 체크하여 안전하게 검색 수행🛠️ Improvements to Make
개선할 사항
👀 References
스크린샷 또는 참고사항