Invariant Violation: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

 

아직 mount 되지 않은 혹은 unmount 된 컴포넌트에 forceUpdate  setState 를 수행하려고 하면 아래와 같은 오류가 발생한다.

그래서 내가 삽질했다;

 

에러가 뜰리가 없는데, 자꾸 나서.. 하나씩 지워나갔는데 다 지워도 에러가 계속 뜨더라.

결국 import까지 하나씩 지워봤는데 react-base를 import하니까 에러가 뜬거였다 ㅂㄷㅂㄷ

 

버전도 낮춰보고 node_module 지우고 재설치하고 별걸 다해봤지만 해결되지 않았다.

 

 

https://github.com/facebook/react-native/issues/16332

 

Invariant Violation: Element type is invalid: expected a string( for built-in components) or a class/function (for composite com

Is this a bug report? yes App.js.txt User_List.php.txt Have you read the Contributing Guidelines? (Write your answer here.) Environment Steps to Reproduce (Write your steps here:) Expected Behavior...

github.com

 

그러다가 깃헙 이슈를 발견했는데 react-base의 image를 react-native의 image로 바꿔보랜다.

으엥 설마 이거겠어 했는데 잘됨,ㅋㅋ

 

공식문서를 찾아봤는데 react-base에 image가 없었다. 없어진건가? react-base의 image를 쓰는 글이나 유투브는 많았는데.

그리고 2차충격,  react-base 공식문서의 예제에서도 image를 react-native에서 임포트했다. 이래서 공식문서로 공부하라고 하는가부다

 

https://docs.nativebase.io/Components.html#Components

 

Components · NativeBase

type Ionicons AntDesign, Ionicons, Entypo, EvilIcons, Feather, FontAwesome, FontAwesome5, Foundation, MaterialIcons, MaterialCommunityIcons, Octicons, Roboto, rubicon-icon-font, SimpleLineIcons, Zocial Specifies icon family from IonIcons

docs.nativebase.io

 

 

+ Recent posts