커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
2주차 숙제하기 전에 에러관련 문의드립니다
[왕초보] 나만의 수익성 앱, 앱개발 종합반
2주차
북마크
박*이
댓글
12
추천
0
조회수
27
조회수
27
답변 완료


2주차 숙제를 할때 pages란 폴더를 만들어서 MainPag.js 를 만들고 그 안에 넣으라고해서 동일하게 적용했는데요.


App.js에서 소스를 그대로 복사해서 붙여넣기 했는데 에러가 떠서요.

무슨말인지 구글링해도 뭐가 잘못된건지를 못찾겠어요.


App.js 파일안에는

import React from 'react';

import MainPage from './pages/MainPage';


export default function App(){

return (<MainPage/>)

}


라고 작성했습니다.



스파르타 즉문즉답





Error: 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.


Check the render method of `App`.


This error is located at:

  in App (created by ExpoRoot)

  in ExpoRoot

  in RCTView (created by View)

  in View (created by AppContainer)

  in RCTView (created by View)

  in View (created by AppContainer)

  in AppContainer

  in main(RootComponent)

at node_modules\expo\build\environment\react-native-logs.fx.js:null in error

at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException

at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException

at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError

at node_modules\expo\build\errors\ExpoErrorManager.js:null in errorHandler

at node_modules\expo\build\errors\ExpoErrorManager.js:null in <anonymous>

at node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:null in ErrorUtils.setGlobalHandler$argument_0

at node_modules\@babel\runtime\helpers\asyncToGenerator.js:null in asyncGeneratorStep

at node_modules\@babel\runtime\helpers\asyncToGenerator.js:null in _next

at node_modules\promise\setimmediate\core.js:null in tryCallOne

at node_modules\promise\setimmediate\core.js:null in setImmediate$argument_0

at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _allocateCallback$argument_0

at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _callTimer

at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in _callReactNativeMicrotasksPass

at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:null in callReactNativeMicrotasks

at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __callReactNativeMicrotasks

at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard$argument_0

at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard

at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in flushedQueue



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴