FrontEnd/React Native 7

[react native] 스토리지 저장하기 asyncStorage

웹 브라우저의 localStorage와 같이 동작하는 저장소 정도로 이해하면 된다.... https://docs.expo.dev/versions/v48.0.0/sdk/async-storage/ AsyncStorage Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React. docs.expo.dev # 패키지 설치 > npx expo install @react-native-async-storage/async-storage 실제 사용법은 아래 사이트를 참고한다. https://react-native-async-storage.github.io/asyn..

[react native] 텍스트 입력 textInput

https://reactnative.dev/docs/textinput TextInput · React Native A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, such as auto-correction, auto-capitalization, placeholder text, and different keyboard types, such as a numeric keypad. reactnative.dev Props - placeholder - keyboardType : 입력모드에 들어갔을 때 키보드 유형을 지정해 준다. 직접 사용해 ..

[react native] 터치 이벤트 컴포넌트

1.TouchableWithoutFeedback https://reactnative.dev/docs/touchablewithoutfeedback TouchableWithoutFeedback · React Native If you're looking for a more extensive and future-proof way to handle touch-based input, check out the Pressable API. reactnative.dev - UI 효과가 없이 터치했을 때 이벤트를 지정해 줄 수 있다. Props onPress : 터치가 시작되어 끝나는 시점에 호출되는 이벤트를 지정해 줄 수 있다. ( === onClick ) onPressIn : 터치가 시작되는 시점에 이벤트를 지정할 수 ..

[react native] 위치정보 가져오기 (expo)

https://docs.expo.dev/versions/latest/sdk/location Location Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React. docs.expo.dev #expo-location 설치 > npx expo install expo-location Method 1. 디바이스 권한요청 (필수) - requestBackgroundPermissionsAsync() : 백그라운드 권한요청 - requestForegroundPermissionsAsync() : 포그라운드 권한요청 - getLastKnownPositionAs..

[react native] 화면 스크롤 하기

https://reactnative.dev/docs/scrollview ScrollView · React Native Component that wraps platform ScrollView while providing integration with touch locking "responder" system. reactnative.dev import {View, ScrollView} from 'react-native'; export default function App() { return ( // 이곳의 컴포넌트들은 scroll 처리 된다. ) } Props - horizontal : 수평 스크롤 모드 (기본 false) - [IOS] indicatorStyle : 스크롤바 스타일 지정 - pagingE..

[react native] 프로젝트 생성 (expo)

실제 react native app을 만들기 위해서는 컴파일을 위한 프로그램이 필요하지만 테스트 / 학습에는 expo를 이용하여 컴파일 과정을 대체할 수 있다. https://expo.dev/ Expo Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React. expo.dev expo 실행을 위해 로그인이 필요하니 가입하도록 한다. # 1.expo-cli 설치 > npm install -g expo-cli # 2.expo app 생성 > npx create-expo-app my-app # 3.expo app login > npx expo login..