SetupProfile 컴포넌트에서 회색 원을 누르면 launchImageLibrary 함수를 호출하도록 구현해봅시다.
components/SetupProfile.js
(import {Pressable, StyleSheet, View, Platform} from 'react-native'; import {launchImageLibrary} from 'react-native-image-picker'; function () { ( ) const onSelectImage = () => { launchImageLibrary( { mediaType: 'photo', maxWidth: 512, maxHeight: 512, includeBase64: Platform.OS === 'android', }, (res) => { console.log(res); }, ); }; return ( <View style={styles.block}> <Pressable style={styles.circle} onPress={onSelectImage} /> <View style={styles.form}> <BorderedInput placeholder="닉네임" value={displayName} onChangeText={setDisplayName} onSubmitEditing={onSubmit} returnKeyType="next" /> <View style={styles.buttons}> <CustomButton title="다음" onPress={onSubmit} hasMarginBottom /> <CustomButton title="취소" onPress={onCancel} theme="secondary" /> </View> </View> </View> ); } ( ))