Error Log(React-naive:TypeError)

이홍경·2021년 12월 6일
0
post-thumbnail

TypeError: undefined is not an object 💡

@react-navigation/native를 사용하는 도중 타입에러......

내용은 이렇다....

TypeError: undefined is not an object (evaluating 'navigation.navigate')
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0

꾀 오랜 시간 검색해 보았지만...별다른 소득은 없었다...그러나 해결은 하였다....

<Stack.Navigator /> 안에 들어 있는 모든 컴포넌트는 navigation객체를 받는줄 알았는데...

아마도 감싸진 컴포넌트의 자식에서 사용하려면 자식에도 props로 전달 해 줘야 하나 보다....

생각보다 해답은 간단하고 가까이에 있었다.....허탈하지만...이렇게 성장하는게 맞겠지?...

profile
개발자를 꿈꾸는 자

0개의 댓글