Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 상일동역
- 개봉역
- 신이문역
- 신혼부부아파트
- 범계역아파트
- 5호선
- 동대문구
- 아파트
- 행당역
- aws cli
- kubectl
- Ansible
- 명령어
- 쿠버네티스
- k8s
- describe-instances
- statefulset
- React Native
- EC2
- Configmap
- 광명
- 답십리역
- 9억이하
- 성남
- 고덕그라시움아파트
- 안양어반포레자연&e편한세상
- ELB
- 외대앞역
- pod
- docker
Archives
- Today
- Total
게으름을 위한 부지런한 게으름뱅리' 블로그
React Native 하루 기록 - Core Components 본문
반응형
Core Components 공식 문서
https://reactnative.dev/docs/components-and-apis
Core Components and APIs · React Native
React Native provides a number of built-in Core Components ready for you to use in your app. You can find them all in the left sidebar (or menu above, if you are on a narrow screen). If you're not sure where to get started, take a look at the following cat
reactnative.dev
Components ?
재사용 가능한 개별적인 여러 조각
Components 종류
1. 클래스형 컴포넌트
- class 키워드 필요
- Component를 상속
- render() 메소드 필요
- state, lifeCycle 기능 사용가능
- 함수형보다 메모리 자원을 더 사용
class FriendList extends React.Component {
render() {
return (
<View>
<Friend name="A" />
<Friend name="B" />
<Friend name="C" />
</View>
)
}
}
2. 함수형 컴포넌트
- state, lifeCycle 관련 기능 사용 불가 -> hook으로 해결
- 클래스형보다 메모리 자원을 덜 사용
- 컴포넌트 선언이 편함
- 공식문서 : 함수형 컴포넌트 + hook 사용을 권장
const Friend = (props) => {
return <Text>{props.name}</Text>;
}
export default () => {
return(
<View>
<Friend name="A" />
<Friend name="B" />
<Friend name="C" />
</View>
)
}
반응형
'IT > FrontEnd' 카테고리의 다른 글
React Native 하루 기록 - SafeAreaView (0) | 2022.12.09 |
---|---|
React Native 하루 기록 - custom Hook (0) | 2022.12.09 |
React Native 하루 기록 - React Hook (1) | 2022.12.08 |
React Native 하루 기록 - Expo Cli (0) | 2022.12.07 |
React Native 하루 기록 - 시작하기 (0) | 2022.12.07 |
Comments