문제 상황
처음 지도가 불러와질 때 Polygon이 뜨지 않는다.
문제 원인
내가 사용 중인 react-google-map api의 functional component는 react strict and/or react@17+에서는 작동하지 않는다고 한다.
https://www.npmjs.com/package/@react-google-maps/api
해결 방법
1. react strict 모드 제거하기
2. react 다운그레이드 하기
둘 중 나는 1번 방법을 선택하였다. (다운그레이드하기 귀찮았다)
참고 문헌
Markers not rendering using @react-google-maps/api
I'm relatively new to react world and particularly to using google maps. I'm using @react-google-maps/api and React version 18. I'm trying to display multiple locations (as markers), however, they ...
stackoverflow.com
'Library-Framework > React' 카테고리의 다른 글
🌟 외부 라이브러리 없이 별점 평점 기능 만들기 (0) | 2023.12.29 |
---|---|
[React] 폰트 파일 추가하기 (0) | 2023.04.08 |
[React] Google Map default zoom 바로 안 먹힘 (0) | 2023.04.03 |
[React] React에서 Google Map API 사용하기 & Polygon 그리기 (0) | 2023.02.19 |
[React] 그래프 라이브러리 쓰기 (ApexChart) (0) | 2023.02.19 |