React Navigation 셋업 오류
1260
1 asked
routes.js 작성하고 AuthStack.Navigator로 화면 호출할때 오류나는거 저만 그런가요...?
Couldn't find a 'component', 'getComponent' or 'children' prop for the screen 'main'. this can happen if you passed 'undefined' you likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing
찾아보니까 import 시킬때
import { 이름 } from './compont';
->
import 이름 from './compont';
이렇게 변경하라는 답변들이 많았는데 전 이미 그렇게 했는데도 오류가 뜨는데 다른 요인이 있을수 있을까요...
해당 import 하는 클래스 파일에도 하단에 export 한 상태입니다...
Answer 1
0
김부릉님, 안녕하세요.
import를 할 때 중괄호 사용 여부는, 다른 파일에서 export하는 방법에 따라 상이합니다.
default로 export를 하게 되면 import할 때 중괄호를 안 쓰고요,
그렇지 않은 경우에는 import할 때 중괄호를 쓰게 됩니다.
e.g.
case1) export하는 파일에서 -> export class example extends Component { ...}
import하는 파일에서 -> import { example } from '[export하는파일경로]'
case2) export하는 파일에서 -> export default class example extends Component { ...}
import하는 파일에서 -> import example from '[export하는파일경로]'
routes.js 작성하고 AuthStack.Navigator로 화면 호출할때 오류 라고 하는게 정확히 어떤 부분인지요?
강의에서는 'compont' 라는 경로를 사용하지 않는데, 혹시 경로나 파일 이름을 부분적으로 임의 생성하신거라면, import시 문제가 될 수 있습니다.
감사합니다.
더백님 감사합니다
1
37
1
39. Main화면 추가 UI 에서 자료는 어디서 받나요??
0
36
1
미션 마감일시를 좀 늘려주세요
0
45
1
개인브랜딩 사이트 만들기가 마감일시가 있었네요.
0
38
1
최종 과제 제출
0
82
3
주사위앱 소개 및 레이아웃 설정 문제
0
59
2
파이어베이스 문의
0
41
2
라우터 궁금사항
0
36
1
secureTextEntry 설정에 관해
0
58
2
expo 55 tabs 사라짐 이슈
0
82
2
searchable이 화면 하단에 위치해요
0
62
2
환불관련 문의 드립니다.
0
144
1
windows 환경 npx pod-install ios 실행 에러
0
1473
1
굳이 react-native-text-truncate를 사용하는 이유가 있나요?
0
282
0
현업에서 action creator 함수가 비동기인 경우가 많이 있나요?
0
199
0
android debugger 연결이 안 됩니다.
0
394
0
클래스형 함수형 질문있습니다
0
235
0
Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4 에러
0
742
0
AsyncStorage를 이용한 Token 읽어오기에서 GetToken이 undefined를 반환합니다.
0
182
0
ios 시뮬레이터 실행 오류 납니다.An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405)
0
4460
1
Could not find "store" in the context of "Connect(AuthForm)"
1
716
1
this.props.signIn(submittedForm) Error
0
143
0
ReferenceError: Can't find variable: _UIManager 이런 에러가 나는데 혹시 어떻게 해결해야할지 알 수 있을까요?
0
293
0
에러가 납니다...
0
545
1

