import React from 'react';
import {Text, View} from 'react-native';
const SampleApp = () => {
return (
<View
style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}}>
<Text>Hello, World!</Text>
</View>
)
}
export default SampleApp;
<aside> π‘ import React from 'react';
</aside>
(κ° νλ«νΌμ λ§λ λ€μ΄ν°λΈ μ»΄ν¬λνΈλ‘ λ³νλ JSX λ₯Ό μ¬μ©νκΈ° μν΄ React import
<aside> π‘ import {Text, View} from 'react-native';
</aside>
react-native μμ Text, View μ»΄ν¬λνΈλ₯Ό import
ν¨μν μ»΄ν¬λνΈμ΄λ©΄μ μΉμμμ 리μ‘νΈμ κ°μ λ°©μμΌλ‘ λμνλ SampleApp ν¨μ
μ΄ ν¨μλ View μ»΄ν¬λνΈλ₯Ό 리ν΄ν¨
View μ»΄ν¬λνΈλ Text λ₯Ό μμμΌλ‘ κ°μ§κ³ μκ³ style λ μ μ©λμ΄μμ
View μ μ€νμΌ μ§μ (flex, justifyContent, alignItems)
μμ Text νκ·Έ μ§μ (TextView κ°μ 건κ°λ΄)
β μ¦ λ¦¬μ‘νΈ λ€μ΄ν°λΈ μ±μ λ§λ λ€λ κ²μ μλ§μ μλ‘μ΄ μ»΄ν¬λνΈλ₯Ό λ§λλ κ²μ μλ―Έ