React Native Basics3
Handle Taps with Pressable
- Pressable 컴포넌트 : 아이템을 터치할 수 있게 인식시켜줌(Touchable, TouchavleHighlight, TouchableNativeFeedback, TouchableOpacity등 다양한 컴포넌트가 있으나 Touchable 컴포넌트는 옛날 버전에서 쓰임)
filter
: 필터는 맵처럼 JavaScript에 내장된 메서드로 배열에서 호출할 수 있다.
이전 배열에서 필터로 걸러낸 모든 아이템을 제외한 새로운 배열을 반환한다.
true를 반환하면 아이템은 유지
false를 반환하면 아이템은 제외bind
: 표준 JavaScript 함수로 기본적으로 나중에 실행할 함수를 미리 조정할 수 있게 해줌
iOS Android Styling Differences
Android
전용 android_ripple프로퍼티
iOS
style 프로퍼티를 추가해서 스타일 적용
함수 사용가능
Styling the Modal Overlay
- React Native에 내장된 모달 컴포넌트가 있음
- 모달은 animationType 프로퍼티도 제공함
Opening and Closing the Modal
- 코드 참조
Working with Images
- source 프로퍼티 : 원하는 이미지를 지목
-
이미지 연결을 위해
require
함수를 사용 StatusBar
: Expo에서 제공하는 컴포넌트. 상태 표시줄의 모양을 상세히 조절할 수 있다.
변경파일
app/(tabs)/index.tsx
components/GoalInput.tsx
components/GoalItem.tsx