에러 내용

에러가 난 부분

getValue 함수는 다음과 같다.

에러의 해결을 위해 구글링을 하던 중 아래 링크의 글들이 도움이 되었다.
https://stackoverflow.com/questions/55720466/typeerror-cannot-read-property-target-of-undefined
TypeError: Cannot read property 'target' of undefined
I am trying to read Excel data file using following function: handleFiles = (f, evt) => { var name = f.name; const reader = new FileReader(); reader.onload = evt => { /* ...
stackoverflow.com
onChange={(e) => { getValue(); setRegisterEmail(e.target.value); }} />
이 부분에서 getValue();를 getValue(e); 로 수정해주니 잘 작동한다. 명시적으로 써 줘야 한다.
관련해서 나중에 발생할 에러에 도움이 될 것 같은 글
'React > 오류 모음집' 카테고리의 다른 글
| React) export 'Outlet' (imported as 'Outlet') was not found in 'react-router-dom' 해결방법 (0) | 2023.03.23 |
|---|---|
| 리액트 오류) Each child in a list should have a unique key prop (0) | 2023.03.22 |
| react 에러 ) background-image 설정 시 module not found 라고 나오는 에러 (0) | 2023.03.14 |
| react) dangerouslySetInnerHTML 사용 시 에러 (0) | 2022.08.29 |
| react) favicon.ico를 임의로 만들어서 프로젝트에 추가했는데 표시되는 아이콘이 너무 작아요. 에 대한 간단한 해결 (0) | 2022.08.26 |