오류 상황:
TypeError: Cannot read property 'push' of undefined.
엘리먼트 폴더에 버튼을 따로 만들었는데, 버튼 적용이 안되었음.
해결방안:
<Button _onClick={() => {history.push('/');}} text="글쓰기"></Button>
props와 history 두 가지로 이벤트를 받고 있었다. 둘 중에 하나만 썼어야 한다!
그리고 onclick아니고 대문자인거 확인하기!
728x90
'✏️ 기록 > 에러 일기' 카테고리의 다른 글
[210714]React wrapper: React does not recognize the `_onChange` prop on a DOM element (0) | 2021.07.14 |
---|---|
[210713] two children with the same key (0) | 2021.07.13 |
[210707] lodash 오류 (0) | 2021.07.08 |
[210706] POST 오류 (0) | 2021.07.06 |
에러일기에 대하여 (0) | 2021.07.06 |