Error: Element type is invalid: expected a string (for built-in components) or a class/function❗️

2024. 6. 26. 18:16·Error
반응형

❗️Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

오류발생원인

  • components 의 이름과 코드 경로가 잘못됬을경우 발생
  • export default 작성하지 않을때도 발생

본인은 뒤에 export default 작성하지 않아서 오류가 발생

실수코드 예시

'use client';

import SideBar from '@/components/SideBar/SideBar';
import ThumbnailEditor from '@/components/ThumbnailEditor/ThumbnailEditor';
import styled from 'styled-components';

const Container = styled.div`
  display: flex;
  flex-direction: row;
`;

const thumbnailgenerator = () => {
  return (
    <Container>
      <ThumbnailEditor />
      <SideBar />
    </Container>
  );
};

 

위에 코드에 마지막에 export default thumbnailgenerator 를 작성하지 않아 오류가 발생했다.

반응형

'Error' 카테고리의 다른 글

[React-Native CLI] react-native-vector-icons 설치에러 해결 과정  (0) 2025.01.13
[ React-Native CLI ] 설치후 Build 안되는 에러해결 방법  (0) 2024.12.25
[ React-Native CLI ] 개발 오류 ❗️Execution failed for task ':react-native-safe-area-context:compileDebugKotlin'.  (2) 2024.12.25
Next.js 에❗️TypeError: Cannot read properties of undefined (reading 'prototype')  (1) 2024.05.13
❗️Parsing error : Cannot find module 'next/babel’ 오류 해결  (3) 2024.05.08
'Error' 카테고리의 다른 글
  • [ React-Native CLI ] 설치후 Build 안되는 에러해결 방법
  • [ React-Native CLI ] 개발 오류 ❗️Execution failed for task ':react-native-safe-area-context:compileDebugKotlin'.
  • Next.js 에❗️TypeError: Cannot read properties of undefined (reading 'prototype')
  • ❗️Parsing error : Cannot find module 'next/babel’ 오류 해결
WHITE_FROST
WHITE_FROST
개발공부리뷰블로그
    반응형
  • WHITE_FROST
    하얀하얀IT
    WHITE_FROST
  • 전체
    오늘
    어제
    • 분류 전체보기 (126)
      • Stack (46)
        • Next.js (8)
        • React (13)
        • React-Native (15)
        • TypeScript (0)
        • Python (2)
        • JavaScript (3)
        • Android (1)
        • DB (2)
        • JAVA (1)
      • Design Pattern (1)
      • AI (3)
      • Obsidian (1)
      • Error (7)
      • 알고리즘 정리 (6)
      • 알고리즘 문제풀이 (46)
      • 공부일상 (6)
      • 기타 (6)
      • Tip (3)
  • 블로그 메뉴

    • 홈
    • 태그
    • 미디어로그
    • 위치로그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    ios
    react-native
    d1
    티스토리챌린지
    D2
    mongoDB Atlas
    코딩테스트
    react
    react-native-maps
    reactnative
    Expo
    리액트네이티브
    프로그래머스
    javascript
    boj
    mongodb cloud
    알고리즘
    백준
    Ai
    React-Native cli
    hooks
    코테
    Next.js
    SWEA
    React Hooks
    java
    error
    Python
    ReactHook
    오블완
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
WHITE_FROST
Error: Element type is invalid: expected a string (for built-in components) or a class/function❗️
상단으로

티스토리툴바