React-Native Tutorial To do list [ #2 ]

์กฐํŒ”๋กœยท2020๋…„ 9์›” 20์ผ
0

React-Native-Todolist

๋ชฉ๋ก ๋ณด๊ธฐ
2/15
post-thumbnail

React Native Tutorial ๋”ฐ๋ผํ•˜๊ธฐ ๐Ÿ“ฑ

๐Ÿ“Œ ํŠœํ† ๋ฆฌ์–ผ์„ ๋”ฐ๋ผํ•œ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค!

1. Create New Project

react-native init ReactNativeTodos

๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ReactNativeTodos ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•ด์ค์‹œ๋‹ค!

cd ReactNativeTodos
react-native run-android 

๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์•ฑ์„ ์‹คํ–‰ํ•ด๋ด…์‹œ๋‹ค!


2. App.js ์ˆ˜์ •

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"'์ด๋ž€๋‹ค.

profile
ํ˜„์‹ค์— ์•ˆ์ฃผํ•˜์ง€ ์•Š๊ณ  - ๊ฐœ๋ฐœ์ž

0๊ฐœ์˜ ๋Œ“๊ธ€