App - Android 학습 일지
[wegram] Unhandled promise rejection .... currentUser.uid
반투
2022. 7. 23. 15:51
터미널상 에러
[Unhandled promise rejection: TypeError: null is not an object (evaluating 'currentUser.uid')]
at node_modules/react-native/Libraries/Pressability/Pressability.js:702:17 in _performTransitionSideEffects
at node_modules/react-native/Libraries/Pressability/Pressability.js:639:6 in _receiveSignal
at node_modules/react-native/Libraries/Pressability/Pressability.js:520:8 in responderEventHandlers.onResponderRelease
at node_modules/react-native/Libraries/Text/Text.js:112:14 in onResponderRelease
디바이스 상 에러
없는 값을 조회하려고 할때 발생하는 에러.....
Sol)
더보기
[Unhandled promise rejection: TypeError: null is not an object (evaluating 'currentUser.email')]
currentUser에 값이 비어 있단 뜻입니다.
이 오류는
엑스포를 재실행 하거나, 서버가 리로드 될 때 (Xcode 저장 버튼 누르면, 보통 자동 리로드)
로그인이 풀려서 발생하는 오류입니다
이걸 해결하려면,....
로그인이 일단 되면, currentUser 값을 Asyncstorage에 담는 것이 방법이 될수 있습니다.
Asyncstorage는 서버가 리로드 되도, 값을 영구히 저장 하고 있기 때문입니다
앱을 처음 열어서 로그인이 안되어 있어서....
로그인 된석으로 표시된 점은 수정/보완할것...