• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    해결됨

Stack-Navigation 학습중 에러메세지 관련입니다

21.12.03 18:30 작성 조회수 103

0

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

 

위의 이런 에러가 나는데 몇시간 헤메이어도 도무지 제실력으론 찾지를 못하겠네요

범준님 부탁드려용 사랑해용

 

소스는 깃헙 에 올려두었사옵니다

https://github.com/dongguntechnology/Stack-Navigation

답변 4

·

답변을 작성해보세요.

0

shafeel2님의 프로필

shafeel2

질문자

2021.12.04

앗 ~  !  이런 실수를   

범준님 넘나 감사드립니다

0

shafeel2님의 프로필

shafeel2

질문자

2021.12.03

Button 컴포넌트를 작성한 /components/Button.js 파일에서  

export default Button;

 

를 추가하여도 같은 에러메세지기 뜨네요  ..

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of `App`.

 

 

안녕하세요, 

 

Stack.js 파일에서도 export 가 잘못되었네요. 

 

export default Stack; 이 아니라

export default StackNav; 로 하셔야 합니다. 

  

깃헙에 올릴때, package.json, app.json, babel.config.js파일과 assets 폴더까지 포함된 프로젝트 전체를 올려주세요

  

즐거운 하루 되세요

감사합니다. 

추가적으로, 강의를 촬영할 당시와 지금은 라이브러리 버전에 차이가 있습니다. 

버전 차이에 따라 경고 혹은 에러가 발생할 수 있습니다. 

현재 기준 정확한 사용 방법은 공식 문서를 확인하는것을 권장합니다. 

https://reactnavigation.org/docs/stack-navigator/

감사합니다. 

0

shafeel2님의 프로필

shafeel2

질문자

2021.12.03

헉 !  이런 실수를 캄사합니다

0

안녕하세요 shafeel2님, 

  

Button 컴포넌트를 작성한 /components/Button.js 파일에서 export를 안하셨네요

Button.js 파일 마지막에 다음 코드를 작성하고 다시 실행해 보시기 바랍니다. 

  

export default Button;

  

즐거운 하루 되세요

감사합니다.