react native는 웹이 아니기 때문에 div는 사용 할 수 없다
import {StatusBar } from 'expo-status-bar'
로 임포트해서 사용 할 수 있다StyleSheet 예시
- const styles = StryleSheet.create({})
- 웹에서 하던 메소드가 없을 수 있다
- 예시1
<View style={styles.container}> const styles = StyleSheet.create({ container: { marginTop: 50, }, bigBlue: { color: 'blue', fontWeight: 'bold', fontSize: 30, }, red: { color: 'red', }, });
- 예시2(인라인으로 작성 가능)
<View style={{ width: 50, height: 50, backgroundColor: 'powderblue', }} />
- 예시3(자동완성이 되지 않음)
const styles = { text:{ width: 50, height: 50, backgroundColor: 'powderblue' } }
import { StyleSheet, Text, View } = 'react-native'
로 사용하게 된다