๐ ํํ ๋ฆฌ์ผ์ ๋ฐ๋ผํ ํ๋ก์ ํธ์ ๋๋ค!
react-native init ReactNativeTodos
๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ์ฌ ReactNativeTodos ํ๋ก์ ํธ๋ฅผ ์์ฑํด์ค์๋ค!
cd ReactNativeTodos
react-native run-android
๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ์ฌ ์ฑ์ ์คํํด๋ด ์๋ค!
App.js๋ฅผ ์๋ ์ฝ๋์ฒ๋ผ ์์ ํด์ฃผ์ธ์
import React from 'react';
import {SafeAreaView, StyleSheet, Text} from 'react-native';
const App = () => {
return (
<SafeAreaView style={styles.container}>
<Text>Hello World</Text>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
export default App;
๊ฒฐ๊ณผ
์ด๋ ๊ฒ Hello World๊ฐ ์ฐํ๋ฉด ๋๋ค!!
์ฃผ์์ฌํญ
react-native run android ํ๋ฉด Node๊ฐ ์๊ธฐ๊ณ
Node๋ ์ด๋ฐ ํ๋ฉด์ธ๋ฐ ํ์ผ ์์ ํ๊ณ reloadํ ๋ ์ด Node์์ r์ ๋๋ฌ์ค์ผ ํ๋ค.
'To reload the app press "r"'์ด๋๋ค.