Project/jigu-tory

#10 : 지도 마무리

heesue 2021. 7. 1. 20:17

1. 지도 마무리

- 검색 버튼 누르면 기본은 카페명으로 검색하도록 수정
- 엔터 버튼으로 검색 기능 추가
- 인포윈도우 카페 이름 갖고와서 띄우기 (인포윈도우 자체는 띄움)


2. Error Handling

기능에 문제가 나는 에러는 아니었는데 콘솔창에 떠 있는 게 신경쓰여서 한 번 찾아본 에러이다.

Warning: React does not recognize the `computedMatch` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `computedmatch` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

 

이런 에러가 났는데 App.jsx 파일에서 난 에러였다. 아래 문서를 참고한 결과 Switch 태그 안에 fragment 태그를 써야 한다는 것을 알게 되었다. 리액트 공식 문서에도 다음과 같은 말이 있다.

The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as a legal DOM attribute/property. You should ensure that your DOM elements do not have spurious props floating around.

React에서 합법적 인 DOM 속성 / 속성으로 인식되지 않는 소품으로 DOM 요소를 렌더링하려고하면 unknown-prop 경고가 발생합니다. DOM 요소에 허위 소품이 떠 다니지 않도록해야합니다.

 

-> 참고한 문서
https://velog.io/@kwakky/%EB%A6%AC%EC%95%A1%ED%8A%B8-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EC%98%A4%EB%A5%98-%EC%88%98%EC%A0%95Router