728x90
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
React로 개발하다가 오랜만에 본 에러 같은데... 뭔지 모르겠는 그런 에러....
프로젝트 코드를 작성할 때는 VSCode 스니펫을 이용해서 기본 작성이 된 상태에서 하다보니 거의 만나기 어려운 에러인데 간단한 테스트를 할 때 codesandbox에서는 직접 코드를 작성해야하기 때문에 나타난 에러입니다.
CodeSandbox: Online Code Editor and IDE for Rapid Web Development
Optimized for frameworks Custom environments built specifically for React, Vue, Angular, and many more.
codesandbox.io
저는 export default가 없어서 나타난 에러입니다.
바보같이 export를 까먹었죠....ㅋㅋㅋㅋ

혹시 codesandbox에서도 스니펫을 사용할 수 있나요?? 아시는 분은 정보 공유 좀 해주세요 ㅋㅋ큐ㅠㅠ
반응형
'Frontend > React' 카테고리의 다른 글
[React] Chart 라이브러리 비교하기 (0) | 2022.03.21 |
---|---|
[React] Error : A component is changing an uncontrolled input of type text to be controlled (0) | 2021.10.12 |
React Quill Image Resize Code (2) | 2021.08.19 |
[React] Html2Canvas를 이용하여 화면 캡쳐하기 (0) | 2021.07.20 |
[React] 페이지 이동시 scroll 복귀 (0) | 2021.05.20 |
댓글