다음으로 이미지 업로드 및 사용자 정보 업데이트가 잘 된 것을 검증하기 위해 MainTab 컴포넌트에서 user.photoURL이 존재한다면 Image 컴포넌트를 통해 화면에 보여주도록 구현해줍시다.

    screens/MainTab.js

    import React from 'react';
    import {Image, StyleSheet, Text, View} from 'react-native';
    import {useUserContext} from '../contexts/UserContext';
    
    function MainTab() {
      const {user} = useUserContext();
      return (
        <View style={styles.block}>
          {user.photoURL && (
            <Image
              source={{uri: user.photoURL}}
              style={{width: 128, height: 128, marginBottom: 16}}
              resizeMode="cover"
            />
          )}
          <Text style={styles.text}>Hello, {user.displayName}</Text>
        </View>
      );
    }
    
    (...)
    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.